mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Move definition of animatable for shorthands to Shorthand object
By moving this definition to the Shorthand object we can more easily re-use it in subsequent patches in this series.
This commit is contained in:
parent
f8e2f85cdc
commit
09c2b1b930
2 changed files with 11 additions and 11 deletions
|
@ -234,6 +234,16 @@ class Shorthand(object):
|
||||||
self.allowed_in_keyframe_block = allowed_in_keyframe_block \
|
self.allowed_in_keyframe_block = allowed_in_keyframe_block \
|
||||||
and allowed_in_keyframe_block != "False"
|
and allowed_in_keyframe_block != "False"
|
||||||
|
|
||||||
|
def get_animatable(self):
|
||||||
|
animatable = False
|
||||||
|
for sub in self.sub_properties:
|
||||||
|
if sub.animatable:
|
||||||
|
animatable = True
|
||||||
|
break
|
||||||
|
return animatable
|
||||||
|
|
||||||
|
animatable = property(get_animatable)
|
||||||
|
|
||||||
|
|
||||||
class Method(object):
|
class Method(object):
|
||||||
def __init__(self, name, return_type=None, arg_types=None, is_mut=False):
|
def __init__(self, name, return_type=None, arg_types=None, is_mut=False):
|
||||||
|
|
|
@ -195,21 +195,11 @@ impl TransitionProperty {
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
|
pub fn nscsspropertyid_is_animatable(property: nsCSSPropertyID) -> bool {
|
||||||
match property {
|
match property {
|
||||||
% for prop in data.longhands:
|
% for prop in data.longhands + data.shorthands_except_all():
|
||||||
% if prop.animatable:
|
% if prop.animatable:
|
||||||
${helpers.to_nscsspropertyid(prop.ident)} => true,
|
${helpers.to_nscsspropertyid(prop.ident)} => true,
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
% for prop in data.shorthands_except_all():
|
|
||||||
<%
|
|
||||||
animatable = "false"
|
|
||||||
for sub in prop.sub_properties:
|
|
||||||
if sub.animatable:
|
|
||||||
animatable = "true"
|
|
||||||
break
|
|
||||||
%>
|
|
||||||
${helpers.to_nscsspropertyid(prop.ident)} => ${animatable},
|
|
||||||
% endfor
|
|
||||||
_ => false
|
_ => false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue