mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
style: Remove get_animation_rule_by_cascade.
It's pretty useless.
This commit is contained in:
parent
8d34aacb3b
commit
c5bfc81b74
3 changed files with 15 additions and 36 deletions
|
@ -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<Arc<Locked<PropertyDeclarationBlock>>> {
|
||||
None
|
||||
}
|
||||
|
||||
/// Get the combined animation and transition rules.
|
||||
fn get_animation_rules(&self) -> AnimationRules {
|
||||
if !self.may_have_animations() {
|
||||
|
|
|
@ -1084,17 +1084,6 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_animation_rule_by_cascade(
|
||||
&self,
|
||||
cascade_level: ServoCascadeLevel,
|
||||
) -> Option<Arc<Locked<PropertyDeclarationBlock>>> {
|
||||
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<Arc<Locked<PropertyDeclarationBlock>>> {
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue