summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-29 21:49:41 +0200
committerAndreas Kling <kling@serenityos.org>2022-03-29 21:50:31 +0200
commite7eb6241c235bf844868b39873b62f021c6f2b66 (patch)
tree77a97d863aa3c35c4859987bc39472161316c4b5 /Userland
parent941d152a88d86808deb4797333b10d6c40440315 (diff)
downloadserenity-e7eb6241c235bf844868b39873b62f021c6f2b66.zip
LibWeb: Ignore list-item marker boxes in height:auto calculation
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Layout/FormattingContext.cpp6
1 files changed, 6 insertions, 0 deletions
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());