Skip to content
Permalink
Browse files

single_keywords supports custom_consts map for enum. r=heycam

We need it to convert PlaybackDirection::Alternate_reverse in Gecko to
alternate-reverse in Servo.
  • Loading branch information...
Hiroyuki Ikezoe authored and hiikezoe committed Jan 6, 2017
1 parent 2a2a89b commit ff1db63922dccd5e82fad4dcafc9244eb6371e25
Showing with 3 additions and 3 deletions.
  1. +3 −3 components/style/properties/data.py
@@ -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()

0 comments on commit ff1db63

Please sign in to comment.
You can’t perform that action at this time.