Create a generic flag system for properties

This commit is contained in:
Nazım Can Altınova 2017-04-01 01:57:47 +03:00
parent 355d5f89da
commit 67799f9445
No known key found for this signature in database
GPG key ID: AF9BCD7CE6449954
6 changed files with 36 additions and 35 deletions

View file

@ -128,8 +128,7 @@ class Longhand(object):
need_clone=False, need_index=False, gecko_ffi_name=None, depend_on_viewport_size=False,
allowed_in_keyframe_block=True, complex_color=False, cast_type='u8',
has_uncacheable_values=False, logical=False, alias=None, extra_prefixes=None, boxed=False,
creates_stacking_context=False, fixpos_cb=False, abspos_cb=False,
allowed_in_page_rule=False):
flags=None, allowed_in_page_rule=False):
self.name = name
if not spec:
raise TypeError("Spec should be specified for %s" % name)
@ -153,9 +152,7 @@ class Longhand(object):
self.alias = alias.split() if alias else []
self.extra_prefixes = extra_prefixes.split() if extra_prefixes else []
self.boxed = arg_to_bool(boxed)
self.creates_stacking_context = arg_to_bool(creates_stacking_context)
self.fixpos_cb = arg_to_bool(fixpos_cb)
self.abspos_cb = arg_to_bool(abspos_cb)
self.flags = flags.split() if flags else []
self.allowed_in_page_rule = arg_to_bool(allowed_in_page_rule)
# https://drafts.csswg.org/css-animations/#keyframes
@ -190,7 +187,7 @@ class Longhand(object):
class Shorthand(object):
def __init__(self, name, sub_properties, spec=None, experimental=False, internal=False,
allowed_in_keyframe_block=True, alias=None, extra_prefixes=None,
allowed_in_page_rule=False):
allowed_in_page_rule=False, flags=None):
self.name = name
if not spec:
raise TypeError("Spec should be specified for %s" % name)
@ -204,6 +201,7 @@ class Shorthand(object):
self.alias = alias.split() if alias else []
self.extra_prefixes = extra_prefixes.split() if extra_prefixes else []
self.allowed_in_page_rule = arg_to_bool(allowed_in_page_rule)
self.flags = flags.split() if flags else []
# https://drafts.csswg.org/css-animations/#keyframes
# > The <declaration-list> inside of <keyframe-block> accepts any CSS property