mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: remove is_servo(), as_servo() and as_servo_mut()
This commit adds a need_index prop to the style system, and autogenerates iterators, and a get_xxx_mod(i) function from a get_xxx_prop() and get_xxx_at(index) functions. This allows us to (finally!) take rid of the as_servo() hack. There are a few unimplemented clones, but I'm just too lazy for that right now.
This commit is contained in:
parent
ba53c4ea8d
commit
30963dd74d
7 changed files with 296 additions and 81 deletions
|
@ -57,7 +57,6 @@ class Longhand(object):
|
|||
self.experimental = ("layout.%s.enabled" % name) if experimental else None
|
||||
self.custom_cascade = custom_cascade
|
||||
self.internal = internal
|
||||
self.need_clone = need_clone
|
||||
self.need_index = need_index
|
||||
self.gecko_ffi_name = gecko_ffi_name or "m" + self.camel_case
|
||||
self.derived_from = (derived_from or "").split()
|
||||
|
@ -72,6 +71,12 @@ class Longhand(object):
|
|||
assert animatable == "True" or animatable == "False"
|
||||
self.animatable = animatable == "True"
|
||||
|
||||
# NB: Animatable implies clone because a property animation requires a
|
||||
# copy of the computed value.
|
||||
#
|
||||
# See components/style/helpers/animated_properties.mako.rs.
|
||||
self.need_clone = need_clone or self.animatable
|
||||
|
||||
|
||||
class Shorthand(object):
|
||||
def __init__(self, name, sub_properties, experimental=False, internal=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue