mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 23:29:52 +00:00
LibWeb: Use partial layout tree rebuild in element's style invalidation
This allows us to avoid a full layout tree rebuild after change of "display" property, which happens frequently in practice. It also allows us to avoid a full rebuild after DOM node insertion, since previously, computing styles for newly inserted nodes would trigger a complete layout tree rebuild.
This commit is contained in:
parent
00c9031304
commit
9b26f7eb0f
Notes:
github-actions[bot]
2025-03-06 22:49:27 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 9b26f7eb0f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3842
2 changed files with 23 additions and 12 deletions
|
@ -787,6 +787,9 @@ void Node::insert_before(GC::Ref<Node> node, GC::Ptr<Node> child, bool suppress_
|
|||
}
|
||||
|
||||
if (is_connected()) {
|
||||
if (layout_node() && layout_node()->display().is_contents() && parent_element()) {
|
||||
parent_element()->set_needs_layout_tree_update(true);
|
||||
}
|
||||
set_needs_layout_tree_update(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue