Bug 1341372 - Part 1: Let animation-only restyle include css-transition.

Animation-only restyle should include both Animation and Transition
cascade levels.

MozReview-Commit-ID: 5l6gaJKbixM
This commit is contained in:
Boris Chiou 2017-04-17 14:22:48 +08:00
parent 485a4de729
commit 1c1e487491
6 changed files with 77 additions and 24 deletions

View file

@ -9,7 +9,7 @@
use dom::TElement;
use properties::ComputedValues;
use properties::longhands::display::computed_value as display;
use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint};
use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint};
use rule_tree::StrongRuleNode;
use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage, Snapshot};
#[cfg(feature = "servo")] use std::collections::HashMap;
@ -199,13 +199,13 @@ impl StoredRestyleHint {
// In the middle of an animation only restyle, we don't need to
// propagate any restyle hints, and we need to remove ourselves.
if traversal_flags.for_animation_only() {
if self.0.contains(RESTYLE_CSS_ANIMATIONS) {
self.0.remove(RESTYLE_CSS_ANIMATIONS);
if self.0.intersects(RestyleHint::for_animations()) {
self.0.remove(RestyleHint::for_animations());
}
return Self::empty();
}
debug_assert!(!self.0.contains(RESTYLE_CSS_ANIMATIONS),
debug_assert!(!self.0.intersects(RestyleHint::for_animations()),
"There should not be any animation restyle hints \
during normal traversal");
@ -259,7 +259,7 @@ impl StoredRestyleHint {
/// Returns true if the hint has animation-only restyle.
pub fn has_animation_hint(&self) -> bool {
self.0.contains(RESTYLE_CSS_ANIMATIONS)
self.0.intersects(RestyleHint::for_animations())
}
}