Use LonghandId::is_animatable in PropertyDeclaration::is_animatable

This commit is contained in:
Anthony Ramine 2018-02-04 23:23:21 +01:00
parent 90b37cfa21
commit 3918c983e1

View file

@ -1658,29 +1658,9 @@ impl PropertyDeclaration {
/// Returns true if this property declaration is for one of the animatable /// Returns true if this property declaration is for one of the animatable
/// properties. /// properties.
pub fn is_animatable(&self) -> bool { pub fn is_animatable(&self) -> bool {
match *self { match self.id() {
% for property in data.longhands: PropertyDeclarationId::Longhand(id) => id.is_animatable(),
PropertyDeclaration::${property.camel_case}(_) => { PropertyDeclarationId::Custom(..) => false,
% if property.animatable:
true
% else:
false
% endif
}
% endfor
PropertyDeclaration::CSSWideKeyword(id, _) |
PropertyDeclaration::WithVariables(id, _) => match id {
% for property in data.longhands:
LonghandId::${property.camel_case} => {
% if property.animatable:
true
% else:
false
% endif
}
% endfor
},
PropertyDeclaration::Custom(..) => false,
} }
} }