From f35f605a24f4e26864647daf3648e3de03e8bc81 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 17 Dec 2020 00:58:23 +0100 Subject: [PATCH] LibWeb: Make sure the ICB is at least as tall as the viewport This is a hack until we implement a proper overflow mechanism. For now, this allows us to right-click below the lowest content on the page. --- Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index a79b351732d..9e32619a2cb 100644 --- a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -620,7 +620,9 @@ void BlockFormattingContext::layout_initial_containing_block(LayoutMode layout_m icb.for_each_child_of_type([&](auto& child) { lowest_bottom = max(lowest_bottom, child.absolute_rect().bottom()); }); - icb.set_height(lowest_bottom); + + // FIXME: This is a hack and should be managed by an overflow mechanism. + icb.set_height(max(static_cast(viewport_rect.height()), lowest_bottom)); // FIXME: This is a total hack. Make sure any GUI::Widgets are moved into place after layout. // We should stop embedding GUI::Widgets entirely, since that won't work out-of-process.