mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
LibWeb: Invalidate style *and* layout when removing a DOM node
It's not enough to invalidate only layout, since changes to the DOM tree
may also cause different selectors to apply.
This brings Acid3 back to a score of 100/100. The problem was that a
:last-child selector wasn't rechecked after removing a node that was
previously the last child of its parent.
Regression from f36cbd3b65
.
This commit is contained in:
parent
cbdb5f926c
commit
eff783a6d2
Notes:
sideshowbarker
2024-07-17 01:23:08 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/eff783a6d2 Pull-request: https://github.com/SerenityOS/serenity/pull/18672
|
@ -659,6 +659,9 @@ void Node::remove(bool suppress_observers)
|
|||
// 21. Run the children changed steps for parent.
|
||||
parent->children_changed();
|
||||
|
||||
// Since the tree structure has changed, we need to invalidate both style and layout.
|
||||
// In the future, we should find a way to only invalidate the parts that actually need it.
|
||||
document().invalidate_style();
|
||||
document().invalidate_layout();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue