1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

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.
This commit is contained in:
Andreas Kling 2022-03-01 18:17:10 +01:00
parent 884ebc42b1
commit 6478b460fb

View file

@ -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;