From e7eb6241c235bf844868b39873b62f021c6f2b66 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 29 Mar 2022 21:49:41 +0200 Subject: LibWeb: Ignore list-item marker boxes in height:auto calculation --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Userland/Libraries/LibWeb') diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 9c2f77afd1..e7759e33d7 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -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()); -- cgit v1.2.3