diff --git a/components/style/dom.rs b/components/style/dom.rs index 6d4cd23a934..2e304ba09fa 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -19,7 +19,6 @@ use media_queries::Device; use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock}; #[cfg(feature = "gecko")] use properties::LonghandId; #[cfg(feature = "gecko")] use properties::animated_properties::AnimationValue; -use rule_tree::CascadeLevel; use selector_parser::{AttrValue, PseudoClassStringArg, PseudoElement, SelectorImpl}; use selectors::Element as SelectorsElement; use selectors::matching::{ElementSelectorFlags, QuirksMode, VisitedHandlingMode}; @@ -443,13 +442,6 @@ pub trait TElement None } - /// Get this element's animation rule by the cascade level. - fn get_animation_rule_by_cascade(&self, - _cascade_level: CascadeLevel) - -> Option>> { - None - } - /// Get the combined animation and transition rules. fn get_animation_rules(&self) -> AnimationRules { if !self.may_have_animations() { diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index c768ed0207f..04cf374671a 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1084,17 +1084,6 @@ impl<'le> TElement for GeckoElement<'le> { } } - fn get_animation_rule_by_cascade( - &self, - cascade_level: ServoCascadeLevel, - ) -> Option>> { - match cascade_level { - ServoCascadeLevel::Animations => self.get_animation_rule(), - ServoCascadeLevel::Transitions => self.get_transition_rule(), - _ => panic!("Unsupported cascade level for getting the animation rule") - } - } - fn get_animation_rule( &self, ) -> Option>> { diff --git a/components/style/matching.rs b/components/style/matching.rs index 594717cc52a..c1ead77c8da 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -764,29 +764,27 @@ pub trait MatchMethods : TElement { debug_assert!(context.shared.traversal_flags.for_animation_only()); if replacements.contains(RestyleHint::RESTYLE_SMIL) { - replace_rule_node(CascadeLevel::SMILOverride, - self.get_smil_override(), - primary_rules); + replace_rule_node( + CascadeLevel::SMILOverride, + self.get_smil_override(), + primary_rules, + ); } - let replace_rule_node_for_animation = |level: CascadeLevel, - primary_rules: &mut StrongRuleNode| { - let animation_rule = self.get_animation_rule_by_cascade(level); - replace_rule_node(level, - animation_rule.as_ref().map(|a| a.borrow_arc()), - primary_rules); - }; - - // Apply Transition rules and Animation rules if the corresponding restyle hint - // is contained. if replacements.contains(RestyleHint::RESTYLE_CSS_TRANSITIONS) { - replace_rule_node_for_animation(CascadeLevel::Transitions, - primary_rules); + replace_rule_node( + CascadeLevel::Transitions, + self.get_transition_rule().as_ref().map(|a| a.borrow_arc()), + primary_rules, + ); } if replacements.contains(RestyleHint::RESTYLE_CSS_ANIMATIONS) { - replace_rule_node_for_animation(CascadeLevel::Animations, - primary_rules); + replace_rule_node( + CascadeLevel::Animations, + self.get_animation_rule().as_ref().map(|a| a.borrow_arc()), + primary_rules, + ); } }