From 9b0d158e69717f00d7d8ab225e9be3af050f0abd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 29 Mar 2022 19:51:21 +0200 Subject: [PATCH] LibWeb: Only set children-are-not-inline when inserting in-flow child We were marking block boxes as having non-inline children when inserting any child box, even if the child was out-of-flow. --- Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp index 61c4950cc8..38c60284f2 100644 --- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -168,7 +168,10 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context& insertion_point.prepend_child(*node); else insertion_point.append_child(*node); - insertion_point.set_children_are_inline(false); + + // After inserting an in-flow block-level box into a parent, mark the parent as having non-inline children. + if (!node->is_floating() && !node->is_absolutely_positioned()) + insertion_point.set_children_are_inline(false); } };