1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:28:13 +00:00

LibWeb: Ignore list-item marker boxes in height:auto calculation

This commit is contained in:
Andreas Kling 2022-03-29 21:49:41 +02:00
parent 941d152a88
commit e7eb6241c2

View file

@ -220,6 +220,12 @@ float FormattingContext::compute_auto_height_for_block_level_element(FormattingS
if (child_box->is_absolutely_positioned() || child_box->is_floating())
continue;
// FIXME: This is hack. If the last child is a list-item marker box, we ignore it for purposes of height calculation.
// Perhaps markers should not be considered in-flow(?) Perhaps they should always be the first child of the list-item
// box instead of the last child.
if (child_box->is_list_item_marker_box())
continue;
// FIXME: Handle margin collapsing.
auto const& child_box_state = state.get(*child_box);
return max(0, child_box_state.offset.y() + child_box_state.content_height + child_box_state.margin_box_bottom());