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:
Emilio Cobos Álvarez 2017-07-09 21:01:00 +02:00
parent 95a2ac51c4
commit cc94a8b7cb
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 51 additions and 86 deletions

View file

@ -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>>> {