LibWeb: Do not try to place out-of-flow blocks in anonymous nodes

Currently placing floating blocks in anonymous nodes makes
https://stackoverflow.com/ hang so let's leave it to try
to place only absolute blocks in anonymous nodes for now.

Also it breaks flex formatting when element with floating is
flex child.
This commit is contained in:
Aliaksandr Kalenik 2022-11-26 01:27:34 +03:00 committed by Andreas Kling
parent 91b3a3bb58
commit f74251606d
Notes: sideshowbarker 2024-07-17 03:43:17 +09:00

View file

@ -85,10 +85,6 @@ static Layout::Node& insertion_parent_for_block_node(Layout::NodeWithStyle& layo
return layout_parent;
}
if ((layout_node.is_absolutely_positioned() || layout_node.is_floating()) && layout_parent.last_child()->children_are_inline() && layout_parent.last_child()->is_anonymous()) {
return *layout_parent.last_child();
}
if (!layout_parent.children_are_inline()) {
// Parent block has block-level children, insert this block into parent.
return layout_parent;