mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Undo the optimization for grabbing animation rules from the style data.
This is unfortunate, but for now it complicates things, I would like not needing a ElementData to get the style of an Element in order to fix all the getDefaultComputedStyle bugs. MozReview-Commit-ID: LZvsdFEqrDE
This commit is contained in:
parent
95a2ac51c4
commit
cc94a8b7cb
5 changed files with 51 additions and 86 deletions
|
@ -15,7 +15,7 @@ use data::ElementData;
|
|||
use element_state::ElementState;
|
||||
use font_metrics::FontMetricsProvider;
|
||||
use media_queries::Device;
|
||||
use properties::{ComputedValues, PropertyDeclarationBlock};
|
||||
use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
|
||||
#[cfg(feature = "gecko")] use properties::animated_properties::AnimationValue;
|
||||
#[cfg(feature = "gecko")] use properties::animated_properties::TransitionProperty;
|
||||
use rule_tree::CascadeLevel;
|
||||
|
@ -379,6 +379,18 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
|
|||
None
|
||||
}
|
||||
|
||||
/// Get the combined animation and transition rules.
|
||||
fn get_animation_rules(&self) -> AnimationRules {
|
||||
if !self.may_have_animations() {
|
||||
return AnimationRules(None, None)
|
||||
}
|
||||
|
||||
AnimationRules(
|
||||
self.get_animation_rule(),
|
||||
self.get_transition_rule(),
|
||||
)
|
||||
}
|
||||
|
||||
/// Get this element's animation rule.
|
||||
fn get_animation_rule(&self)
|
||||
-> Option<Arc<Locked<PropertyDeclarationBlock>>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue