diff options
author | Andreas Kling <kling@serenityos.org> | 2022-03-09 17:54:50 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-09 18:14:24 +0100 |
commit | c988cbb8b1e197e5594ab638d359b45491d39ae5 (patch) | |
tree | 534e472f271019c274972dc4127130c80e92cb6e | |
parent | 04311ca7f115a33aa9891b7146407ed8fee3b726 (diff) | |
download | serenity-c988cbb8b1e197e5594ab638d359b45491d39ae5.zip |
LibWeb: Invalidate document style when a node is removed
This forces us to recompute style everywhere, since all kinds of
selectors may produce different results now.
In the future, we should look at narrowing down the invalidation that
occurs here, but for now let's just invalidate everything and make the
results correct before worrying about performance.
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index c6fb28cd65..acfcaca045 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -427,6 +427,8 @@ void Node::remove(bool suppress_observers) } parent->children_changed(); + + document().invalidate_style(); } // https://dom.spec.whatwg.org/#concept-node-replace |