mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make TransitionProperty::from_declaration() convert PropertyDeclaration::{CSSWideKeyword,WithVariables} as well.
This commit is contained in:
parent
c41ade06eb
commit
4516d25889
1 changed files with 13 additions and 0 deletions
|
@ -81,6 +81,7 @@ impl TransitionProperty {
|
||||||
|
|
||||||
/// Get a transition property from a property declaration.
|
/// Get a transition property from a property declaration.
|
||||||
pub fn from_declaration(declaration: &PropertyDeclaration) -> Option<Self> {
|
pub fn from_declaration(declaration: &PropertyDeclaration) -> Option<Self> {
|
||||||
|
use properties::LonghandId;
|
||||||
match *declaration {
|
match *declaration {
|
||||||
% for prop in data.longhands:
|
% for prop in data.longhands:
|
||||||
% if prop.animatable:
|
% if prop.animatable:
|
||||||
|
@ -88,6 +89,18 @@ impl TransitionProperty {
|
||||||
=> Some(TransitionProperty::${prop.camel_case}),
|
=> Some(TransitionProperty::${prop.camel_case}),
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
|
PropertyDeclaration::CSSWideKeyword(id, _) |
|
||||||
|
PropertyDeclaration::WithVariables(id, _) => {
|
||||||
|
match id {
|
||||||
|
% for prop in data.longhands:
|
||||||
|
% if prop.animatable:
|
||||||
|
LonghandId::${prop.camel_case} =>
|
||||||
|
Some(TransitionProperty::${prop.camel_case}),
|
||||||
|
% endif
|
||||||
|
% endfor
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
},
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue