style: Handle logical shorthand animations with variable references correctly.

When we physicalize the declarations for @keyframes, we end up having a physical
declaration with an unparsed value with `from_shorthand` being the logical
shorthand.

Account for this case properly when substituting custom properties, to avoid
panicking.

Differential Revision: https://phabricator.services.mozilla.com/D53663
This commit is contained in:
Emilio Cobos Álvarez 2019-11-19 00:43:34 +00:00
parent 9a43ad996f
commit a7c50b57a1
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
2 changed files with 27 additions and 15 deletions

View file

@ -257,10 +257,12 @@ 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
# For a given logical property return all the physical property names
# corresponding to it.
def all_physical_mapped_properties(self, data):
if not self.logical:
return []
candidates = [s for s in LOGICAL_SIDES + LOGICAL_SIZES + LOGICAL_CORNERS
if s in self.name] + [s for s in LOGICAL_AXES if self.name.endswith(s)]
assert(len(candidates) == 1)
@ -270,7 +272,7 @@ class Longhand(object):
else PHYSICAL_SIZES if logical_side in LOGICAL_SIZES \
else PHYSICAL_AXES if logical_side in LOGICAL_AXES \
else LOGICAL_CORNERS
return [to_phys(self.name, logical_side, physical_side)
return [data.longhands_by_name[to_phys(self.name, logical_side, physical_side)]
for physical_side in physical]
def experimental(self, engine):