style: Handle properly potentially-disabled longhands in a shorthand.

This commit is contained in:
Emilio Cobos Álvarez 2018-02-28 00:43:54 +01:00
parent 15b0a32035
commit 3fd5f796f0
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 24 additions and 1 deletions

View file

@ -229,6 +229,11 @@ class Longhand(object):
def enabled_in_content(self):
return self.enabled_in == "content"
def may_be_disabled_in(self, shorthand, product):
if product == "gecko":
return self.gecko_pref and self.gecko_pref != shorthand.gecko_pref
return self.servo_pref and self.servo_pref != shorthand.servo_pref
def base_type(self):
if self.predefined_type and not self.is_vector:
return "::values::specified::{}".format(self.predefined_type)