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

@ -1561,8 +1561,10 @@ pub mod specified {
pub mod computed {
use app_units::Au;
use euclid::size::Size2D;
use keyframes::Keyframe;
use properties::ComputedValues;
use properties::style_struct_traits::Font;
use std::collections::HashMap;
use std::fmt;
use super::LocalToCss;
use super::specified::AngleOrCorner;
@ -1578,6 +1580,7 @@ pub mod computed {
fn inherited_style(&self) -> &Self::ConcreteComputedValues;
fn style(&self) -> &Self::ConcreteComputedValues;
fn mutate_style(&mut self) -> &mut Self::ConcreteComputedValues;
fn animations(&self) -> Option<&HashMap<String, Vec<Keyframe>>>;
}
pub struct Context<'a, C: ComputedValues> {
@ -1585,6 +1588,7 @@ pub mod computed {
pub viewport_size: Size2D<Au>,
pub inherited_style: &'a C,
pub animations: Option<&'a HashMap<String, Vec<Keyframe>>>,
/// Values access through this need to be in the properties "computed early":
/// color, text-decoration, font-size, display, position, float, border-*-style, outline-style
pub style: C,
@ -1597,6 +1601,7 @@ pub mod computed {
fn inherited_style(&self) -> &C { &self.inherited_style }
fn style(&self) -> &C { &self.style }
fn mutate_style(&mut self) -> &mut C { &mut self.style }
fn animations(&self) -> Option<&HashMap<String, Vec<Keyframe>>> { self.animations }
}
pub trait ToComputedValue {