Make nscssproperty a method of longhand/shorthand/alias class.

This commit is contained in:
Xidorn Quan 2018-04-11 15:55:11 +10:00
parent 2aee174b6d
commit 1599357cff
4 changed files with 22 additions and 30 deletions

View file

@ -68,7 +68,7 @@ pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
match property {
% for prop in data.longhands + data.shorthands_except_all():
% if prop.animatable:
${helpers.to_nscsspropertyid(prop.ident)} => true,
${prop.nscsspropertyid()} => true,
% endif
% endfor
_ => false
@ -154,12 +154,12 @@ impl From<nsCSSPropertyID> for TransitionProperty {
fn from(property: nsCSSPropertyID) -> TransitionProperty {
match property {
% for prop in data.longhands:
${helpers.to_nscsspropertyid(prop.ident)} => {
${prop.nscsspropertyid()} => {
TransitionProperty::Longhand(LonghandId::${prop.camel_case})
}
% endfor
% for prop in data.shorthands_except_all():
${helpers.to_nscsspropertyid(prop.ident)} => {
${prop.nscsspropertyid()} => {
TransitionProperty::Shorthand(ShorthandId::${prop.camel_case})
}
% endfor
@ -179,7 +179,7 @@ pub fn nscsspropertyid_is_transitionable(property: nsCSSPropertyID) -> bool {
match property {
% for prop in data.longhands + data.shorthands_except_all():
% if prop.transitionable:
${helpers.to_nscsspropertyid(prop.ident)} => true,
${prop.nscsspropertyid()} => true,
% endif
% endfor
_ => false