stylo: Don't try to do an animation-only restyle if we're styling newly-inserted content.

It makes just no sense, and I'd rather not complicate the logic in the traversal
implementations, seems easy to just handle it here.

MozReview-Commit-ID: 3PnT2Jyta8g
This commit is contained in:
Emilio Cobos Álvarez 2017-07-22 01:34:47 +02:00
parent 9d0023873e
commit 689ee54db3
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -282,13 +282,19 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed,
_ => panic!("invalid combination of TraversalRootBehavior and TraversalRestyleBehavior"),
};
let needs_animation_only_restyle = element.has_animation_only_dirty_descendants() ||
element.has_animation_restyle_hints();
if needs_animation_only_restyle {
traverse_subtree(element,
raw_data,
traversal_flags | ANIMATION_ONLY,
unsafe { &*snapshots });
// It makes no sense to do an animation restyle when we're restyling
// newly-inserted content.
if !traversal_flags.contains(UNSTYLED_CHILDREN_ONLY) {
let needs_animation_only_restyle =
element.has_animation_only_dirty_descendants() ||
element.has_animation_restyle_hints();
if needs_animation_only_restyle {
traverse_subtree(element,
raw_data,
traversal_flags | ANIMATION_ONLY,
unsafe { &*snapshots });
}
}
if restyle_behavior == Restyle::ForThrottledAnimationFlush {