1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

LibWeb: Ignore empty anonymous block children in height:auto calculation

This fixes a regression on GitHub from
5da7ebb806.

Thanks to Simon for reporting it! :^)
This commit is contained in:
Andreas Kling 2022-03-29 22:27:53 +02:00
parent 1e01a85cdf
commit 0fd51ae811

View file

@ -226,8 +226,13 @@ float FormattingContext::compute_auto_height_for_block_level_element(FormattingS
if (child_box->is_list_item_marker_box())
continue;
// FIXME: Handle margin collapsing.
auto const& child_box_state = state.get(*child_box);
// Ignore anonymous block containers with no lines. These don't count as in-flow block boxes.
if (child_box->is_anonymous() && child_box->is_block_container() && child_box_state.line_boxes.is_empty())
continue;
// FIXME: Handle margin collapsing.
return max(0, child_box_state.offset.y() + child_box_state.content_height + child_box_state.margin_box_bottom());
}
}