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:
Hiroyuki Ikezoe 2017-06-19 15:01:16 +09:00
parent 5a8e2562d5
commit a3da636f69
2 changed files with 11 additions and 3 deletions

View file

@ -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);