style: Refactor to pass animations cleanly, land animation-name parsing as experimental

This commit is contained in:
Emilio Cobos Álvarez 2016-06-17 03:51:57 +02:00
parent c1fd7432e9
commit 60192bb830
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
12 changed files with 152 additions and 30 deletions

View file

@ -128,9 +128,7 @@ pub struct Stylist<Impl: SelectorImplExt> {
BuildHasherDefault<::fnv::FnvHasher>>,
/// A map with all the animations indexed by name.
animations: HashMap<String,
Vec<Keyframe>,
BuildHasherDefault<::fnv::FnvHasher>>,
animations: HashMap<String, Vec<Keyframe>>,
/// Applicable declarations for a given non-eagerly cascaded pseudo-element.
/// These are eagerly computed once, and then used to resolve the new
@ -290,7 +288,8 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
let (computed, _) =
properties::cascade(self.device.au_viewport_size(),
&declarations, false,
parent.map(|p| &**p), None,
parent.map(|p| &**p),
None, None,
Box::new(StdoutErrorReporter));
Some(Arc::new(computed))
} else {
@ -323,7 +322,7 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
let (computed, _) =
properties::cascade(self.device.au_viewport_size(),
&declarations, false,
Some(&**parent), None,
Some(&**parent), None, None,
Box::new(StdoutErrorReporter));
Some(Arc::new(computed))
}
@ -457,6 +456,11 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
pub fn is_device_dirty(&self) -> bool {
self.is_device_dirty
}
#[inline]
pub fn animations(&self) -> &HashMap<String, Vec<Keyframe>> {
&self.animations
}
}
/// Map that contains the CSS rules for a given origin.