mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make TransitionProperty treat all properties that are not transitionable as unsupported
Currently properties that are discretely animated cannot be transitioned. Now that TransitionProperty should only be used for transitions, we can redefine it to treat non-transitionable properties as unsupported. This should allow us to simplify the code and make it more self-documenting (e.g. making TransitionProperty actually relate to transitions).
This commit is contained in:
parent
5ce7b1cc55
commit
e74f7792f5
3 changed files with 47 additions and 46 deletions
|
@ -194,12 +194,15 @@ class Longhand(object):
|
|||
self.animation_value_type = animation_value_type
|
||||
|
||||
self.animatable = animation_value_type != "none"
|
||||
self.transitionable = animation_value_type != "none" \
|
||||
and animation_value_type != "discrete"
|
||||
self.is_animatable_with_computed_value = animation_value_type == "ComputedValue" \
|
||||
or animation_value_type == "discrete"
|
||||
if self.logical:
|
||||
# Logical properties will be animatable (i.e. the animation type is
|
||||
# discrete). For now, it is still non-animatable.
|
||||
self.animatable = False
|
||||
self.transitionable = False
|
||||
self.animation_type = None
|
||||
# NB: Animatable implies clone because a property animation requires a
|
||||
# copy of the computed value.
|
||||
|
@ -242,7 +245,16 @@ class Shorthand(object):
|
|||
break
|
||||
return animatable
|
||||
|
||||
def get_transitionable(self):
|
||||
transitionable = False
|
||||
for sub in self.sub_properties:
|
||||
if sub.transitionable:
|
||||
transitionable = True
|
||||
break
|
||||
return transitionable
|
||||
|
||||
animatable = property(get_animatable)
|
||||
transitionable = property(get_transitionable)
|
||||
|
||||
|
||||
class Method(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue