aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/properties/data.py
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-07-06 05:15:34 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-07-24 03:27:56 +0200
commitbe9acba801312ea8b4ab2367569f335b81309a10 (patch)
treed9589ccf448e63c90ed6c61f818027c2167ff4f7 /components/style/properties/data.py
parent89880727ece6be8515f32d3ad8f0f7e7b17216eb (diff)
downloadservo-be9acba801312ea8b4ab2367569f335b81309a10.tar.gz
servo-be9acba801312ea8b4ab2367569f335b81309a10.zip
style: Introduce PropertyDeclaration::to_physical.
Bug: 1309752 Reviewed-by: heycam MozReview-Commit-ID: FAL04K5G948
Diffstat (limited to 'components/style/properties/data.py')
-rw-r--r--components/style/properties/data.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/components/style/properties/data.py b/components/style/properties/data.py
index 76713cfbcb5..c33eeb7b39c 100644
--- a/components/style/properties/data.py
+++ b/components/style/properties/data.py
@@ -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)