style: Introduce PropertyDeclaration::to_physical.

Bug: 1309752
Reviewed-by: heycam
MozReview-Commit-ID: FAL04K5G948
This commit is contained in:
Emilio Cobos Álvarez 2018-07-06 05:15:34 +02:00
parent 89880727ec
commit be9acba801
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 79 additions and 2 deletions

View file

@ -237,6 +237,21 @@ class Longhand(object):
def type():
return "longhand"
# For a given logical property return all the physical
# property names corresponding to it.
def all_physical_mapped_properties(self):
assert self.logical
logical_side = None
for s in LOGICAL_SIDES + LOGICAL_SIZES:
if s in self.name:
assert not logical_side
logical_side = s
assert logical_side
physical = PHYSICAL_SIDES if logical_side in LOGICAL_SIDES else PHYSICAL_SIZES
return [self.name.replace(logical_side, physical_side).replace("inset-", "") \
for physical_side in physical]
def experimental(self, product):
if product == "gecko":
return bool(self.gecko_pref)