style: Refactor the @keyframes parsing and add adequate computation for it.

This commit is contained in:
Emilio Cobos Álvarez 2016-06-18 15:04:16 +02:00
parent 6a362ae8e8
commit 058bfb39ae
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 103 additions and 43 deletions

View file

@ -7,6 +7,7 @@ use bezier::Bezier;
use cssparser::{Color as CSSParserColor, Parser, RGBA, ToCss};
use dom::{OpaqueNode, TRestyleDamage};
use euclid::{Point2D, Size2D};
use properties::PropertyDeclaration;
use properties::longhands;
use properties::longhands::background_position::computed_value::T as BackgroundPosition;
use properties::longhands::background_size::computed_value::T as BackgroundSize;
@ -68,6 +69,17 @@ impl TransitionProperty {
}
}
pub fn from_declaration(declaration: &PropertyDeclaration) -> Option<Self> {
match *declaration {
% for prop in data.longhands:
% if prop.animatable:
PropertyDeclaration::${prop.camel_case}(..)
=> Some(TransitionProperty::${prop.camel_case}),
% endif
% endfor
_ => None,
}
}
}
impl ToCss for TransitionProperty {