1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

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.
This commit is contained in:
Andreas Kling 2022-03-29 19:51:21 +02:00
parent 1c88536298
commit 9b0d158e69

View file

@ -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);
}
};