mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibWeb: Don't invalidate style of parent of inserted node
There is no need for this invalidation because taking care of siblings is already done by invalidation with `NodeInsertBefore` reason. Parent element itself (without subtree) is always invalidated by `Node::children_changed()` hook, so `:empty` pseudo-class invalidation is already covered.
This commit is contained in:
parent
daf7c1ef60
commit
f7a3f785a8
Notes:
github-actions[bot]
2025-02-06 19:08:21 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/f7a3f785a84 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3476 Reviewed-by: https://github.com/AtkinsSJ
2 changed files with 1 additions and 7 deletions
|
@ -767,12 +767,6 @@ void Node::insert_before(GC::Ref<Node> node, GC::Ptr<Node> child, bool suppress_
|
|||
node->post_connection();
|
||||
}
|
||||
|
||||
if (is_connected()) {
|
||||
// FIXME: This will need to become smarter when we implement the :has() selector.
|
||||
invalidate_style(StyleInvalidationReason::ParentOfInsertedNode);
|
||||
set_needs_layout_tree_update(true);
|
||||
}
|
||||
|
||||
document().bump_dom_tree_version();
|
||||
}
|
||||
|
||||
|
@ -1411,6 +1405,7 @@ void Node::set_needs_style_update(bool value)
|
|||
|
||||
void Node::post_connection()
|
||||
{
|
||||
set_needs_layout_tree_update(true);
|
||||
}
|
||||
|
||||
void Node::inserted()
|
||||
|
|
|
@ -88,7 +88,6 @@ enum class ShouldComputeRole {
|
|||
X(NodeRemove) \
|
||||
X(NodeSetTextContent) \
|
||||
X(Other) \
|
||||
X(ParentOfInsertedNode) \
|
||||
X(SetSelectorText) \
|
||||
X(SettingsChange) \
|
||||
X(StyleSheetDeleteRule) \
|
||||
|
|
Loading…
Add table
Reference in a new issue