style: Add machinery to handle properties enabled in chrome.

This commit is contained in:
Emilio Cobos Álvarez 2017-11-16 03:06:07 +01:00
parent 128bb02e1d
commit bbfb7a47eb
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 69 additions and 27 deletions

View file

@ -210,6 +210,13 @@ class Longhand(object):
return bool(self.gecko_pref)
return bool(self.servo_pref)
# FIXME(emilio): Shorthand and Longhand should really share a base class.
def explicitly_enabled_in_ua_sheets(self):
return self.internal
# TODO(emilio): Change the `internal` field to something like `enabled_in`.
def explicitly_enabled_in_chrome(self):
return False
class Shorthand(object):
@ -264,6 +271,12 @@ class Shorthand(object):
return bool(self.gecko_pref)
return bool(self.servo_pref)
def explicitly_enabled_in_ua_sheets(self):
return self.internal
def explicitly_enabled_in_chrome(self):
return False
class Alias(object):
def __init__(self, name, original):
@ -276,6 +289,17 @@ class Alias(object):
self.allowed_in_page_rule = original.allowed_in_page_rule
self.allowed_in_keyframe_block = original.allowed_in_keyframe_block
def experimental(self, product):
if product == "gecko":
return bool(self.gecko_pref)
return bool(self.servo_pref)
def explicitly_enabled_in_ua_sheets(self):
return self.internal
def explicitly_enabled_in_chrome(self):
return False
class Method(object):
def __init__(self, name, return_type=None, arg_types=None, is_mut=False):