mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
committed by
Jelle Raaijmakers
parent
cbdb5f926c
commit
eff783a6d2
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user