Skip to content

Commit

Permalink
LibWeb: Invalidate layout tree of parent of inserted node
Browse files Browse the repository at this point in the history
f7a3f78 made the layout tree invalidate only the inserted nodes
themselves, but it turned out that CSS containment invalidation relies
on the parent being invalidated as well.
  • Loading branch information
kalenikaliaksandr committed Feb 7, 2025
1 parent f696f20 commit ccb513a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/LibWeb/DOM/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,10 @@ void Node::insert_before(GC::Ref<Node> node, GC::Ptr<Node> child, bool suppress_
node->post_connection();
}

if (is_connected()) {
set_needs_layout_tree_update(true);
}

document().bump_dom_tree_version();
}

Expand Down Expand Up @@ -1405,7 +1409,6 @@ void Node::set_needs_style_update(bool value)

void Node::post_connection()
{
set_needs_layout_tree_update(true);
}

void Node::inserted()
Expand Down

0 comments on commit ccb513a

Please sign in to comment.