mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Determine animated types from specified types
This commit is contained in:
parent
a90e660eac
commit
aa7cc261f8
2 changed files with 17 additions and 6 deletions
|
@ -229,6 +229,11 @@ class Longhand(object):
|
|||
def enabled_in_content(self):
|
||||
return self.enabled_in == "content"
|
||||
|
||||
def base_type(self):
|
||||
if self.predefined_type and not self.is_vector:
|
||||
return "::values::specified::{}".format(self.predefined_type)
|
||||
return "longhands::{}::SpecifiedValue".format(self.ident)
|
||||
|
||||
def specified_type(self):
|
||||
if self.predefined_type and not self.is_vector:
|
||||
ty = "::values::specified::{}".format(self.predefined_type)
|
||||
|
@ -281,6 +286,13 @@ class Longhand(object):
|
|||
}
|
||||
return bool(self.keyword)
|
||||
|
||||
def animated_type(self):
|
||||
assert self.animatable
|
||||
computed = "<{} as ToComputedValue>::ComputedValue".format(self.base_type())
|
||||
if self.is_animatable_with_computed_value:
|
||||
return computed
|
||||
return "<{} as ToAnimatedValue>::AnimatedValue".format(computed)
|
||||
|
||||
|
||||
class Shorthand(object):
|
||||
def __init__(self, name, sub_properties, spec=None, servo_pref=None, gecko_pref=None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue