mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
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:
parent
9d0023873e
commit
689ee54db3
1 changed files with 13 additions and 7 deletions
|
@ -282,13 +282,19 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed,
|
||||||
_ => panic!("invalid combination of TraversalRootBehavior and TraversalRestyleBehavior"),
|
_ => panic!("invalid combination of TraversalRootBehavior and TraversalRestyleBehavior"),
|
||||||
};
|
};
|
||||||
|
|
||||||
let needs_animation_only_restyle = element.has_animation_only_dirty_descendants() ||
|
// It makes no sense to do an animation restyle when we're restyling
|
||||||
element.has_animation_restyle_hints();
|
// newly-inserted content.
|
||||||
if needs_animation_only_restyle {
|
if !traversal_flags.contains(UNSTYLED_CHILDREN_ONLY) {
|
||||||
traverse_subtree(element,
|
let needs_animation_only_restyle =
|
||||||
raw_data,
|
element.has_animation_only_dirty_descendants() ||
|
||||||
traversal_flags | ANIMATION_ONLY,
|
element.has_animation_restyle_hints();
|
||||||
unsafe { &*snapshots });
|
|
||||||
|
if needs_animation_only_restyle {
|
||||||
|
traverse_subtree(element,
|
||||||
|
raw_data,
|
||||||
|
traversal_flags | ANIMATION_ONLY,
|
||||||
|
unsafe { &*snapshots });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if restyle_behavior == Restyle::ForThrottledAnimationFlush {
|
if restyle_behavior == Restyle::ForThrottledAnimationFlush {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue