summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorJohannes Laudenberg <laudenberg@hey.com>2022-10-17 17:50:28 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-18 12:55:34 +0200
commit2547e0b9662aff57509473a9899ba3903412709b (patch)
tree92b94070f0e53547fe138897629ad71e447bfaf5 /Userland/Libraries/LibWeb/Layout
parent3dddc02400e61eed9fc9747ee9611a9242d29dc8 (diff)
downloadserenity-2547e0b9662aff57509473a9899ba3903412709b.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r--Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp2
1 files changed, 2 insertions, 0 deletions
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