Skip to content

Commit

Permalink
single_keywords supports custom_consts map for enum. r=heycam
Browse files Browse the repository at this point in the history
We need it to convert PlaybackDirection::Alternate_reverse in Gecko to
alternate-reverse in Servo.
  • Loading branch information
Hiroyuki Ikezoe authored and Hiroyuki Ikezoe committed Jan 10, 2017
1 parent 2a2a89b commit ff1db63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/style/properties/data.py
Expand Up @@ -60,12 +60,12 @@ def values_for(self, product):

def gecko_constant(self, value):
moz_stripped = value.replace("-moz-", '') if self.gecko_strip_moz_prefix else value
parts = moz_stripped.split('-')
mapped = self.consts_map.get(value)
if self.gecko_enum_prefix:
parts = [p.title() for p in parts]
parts = moz_stripped.split('-')
parts = mapped if mapped else [p.title() for p in parts]
return self.gecko_enum_prefix + "::" + "".join(parts)
else:
mapped = self.consts_map.get(value)
suffix = mapped if mapped else moz_stripped.replace("-", "_")
return self.gecko_constant_prefix + "_" + suffix.upper()

Expand Down

0 comments on commit ff1db63

Please sign in to comment.