LibWeb: Don't join anonymous pseudo wrappers for block node insertion

This can happen if pseudo elements are absolutely positioned, they need
the nearest non-inline parent to determine their position.
This commit is contained in:
Jelle Raaijmakers 2025-11-07 14:39:00 +01:00 committed by Jelle Raaijmakers
parent ac829cf60a
commit c845e2cef7
Notes: github-actions[bot] 2025-11-11 09:50:52 +00:00
4 changed files with 74 additions and 7 deletions

View file

@ -113,8 +113,8 @@ static Layout::Node& insertion_parent_for_block_node(Layout::NodeWithStyle& layo
if (!has_inline_or_in_flow_block_children(*new_parent))
return *new_parent;
// If the block is out-of-flow,
if (layout_node.is_out_of_flow()) {
// If the block is out-of-flow and is not a pseudo element,
if (layout_node.is_out_of_flow() && !layout_node.is_generated_for_pseudo_element()) {
// And the parent's last child is an anonymous block, join that anonymous block.
if (!new_parent->display().is_flex_inside()
&& !new_parent->display().is_grid_inside()