From 2547e0b9662aff57509473a9899ba3903412709b Mon Sep 17 00:00:00 2001 From: Johannes Laudenberg Date: Mon, 17 Oct 2022 17:50:28 +0200 Subject: [PATCH] LibWeb: Use calculate_min_content_height() for sizing of grid children When sizing grid children we now also check whether calculate_min_content_height() adds to the computed height. Previously we were using the result of layout_inner() which led to zero height of not specifically sized block level children. This fixes a height issue with our GitHub page. The footer is now at its place and is not hovering over other content anymore. --- Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp index 76de11c787..e121de505b 100644 --- a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp @@ -572,6 +572,8 @@ void GridFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const independent_formatting_context->parent_context_did_dimension_child_root_box(); if (child_box_state.content_height() > positioned_box.computed_height) positioned_box.computed_height = child_box_state.content_height(); + if (auto min_content_height = calculate_min_content_height(positioned_box.box, available_space.width); min_content_height > positioned_box.computed_height) + positioned_box.computed_height = min_content_height; } // https://drafts.csswg.org/css-grid/#overview-sizing