From 6478b460fb390f103db8ede8e1964ca900184048 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 1 Mar 2022 18:17:10 +0100 Subject: [PATCH] LibWeb: Fix wrong height:auto computation for block with floating child If an element with height:auto has any floating descendants whose bottom margin edge is below the element's bottom content edge, then the height is increased to include those edges. Before this patch, we were stopping at the bottom *content* edge of floating descendants. --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index efbae4e745..f9595ff722 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -260,7 +260,7 @@ float FormattingContext::compute_auto_height_for_block_level_element(FormattingS auto const& child_box_state = state.get(child_box); - float child_box_bottom = child_box_state.offset.y() + child_box_state.content_height; + float child_box_bottom = child_box_state.offset.y() + child_box_state.content_height + child_box_state.margin_box_bottom(); if (!bottom.has_value() || child_box_bottom > bottom.value()) bottom = child_box_bottom;