mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Don't traverse any elements that needed only for animation-only restyles in normal traversal.
Before this patch, we were setting the dirty descendants bit in animation-only restyles and it triggered unnecessary traversal for elements that does not need the traversal (i.e no need selector matching).
This commit is contained in:
parent
5a8e2562d5
commit
a3da636f69
2 changed files with 11 additions and 3 deletions
|
@ -462,7 +462,11 @@ pub trait DomTraversal<E: TElement> : Sync {
|
|||
let el = kid.as_element();
|
||||
if el.as_ref().and_then(|el| el.borrow_data())
|
||||
.map_or(false, |d| d.has_styles()) {
|
||||
unsafe { parent.set_dirty_descendants(); }
|
||||
if self.shared_context().traversal_flags.for_animation_only() {
|
||||
unsafe { parent.set_animation_only_dirty_descendants(); }
|
||||
} else {
|
||||
unsafe { parent.set_dirty_descendants(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
f(thread_local, kid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue