Chromium Code Reviews| Index: Source/core/scripts/make_style_shorthands.py |
| diff --git a/Source/core/scripts/make_style_shorthands.py b/Source/core/scripts/make_style_shorthands.py |
| index db5d1880e61962098d58283f14eae65e094cc2f2..e2f481cb7ecea9b041513a1a2ba876d401a79feb 100644 |
| --- a/Source/core/scripts/make_style_shorthands.py |
| +++ b/Source/core/scripts/make_style_shorthands.py |
| @@ -40,6 +40,7 @@ class StylePropertyShorthandWriter(in_generator.Writer): |
| defaults = { |
| 'longhands': "", |
| + 'runtimeConditional': None, |
|
Julien - ping for review
2013/08/09 16:47:30
I would rename this to is 'runtimeEnabledShorthand
|
| } |
| def __init__(self, in_files, enabled_conditions): |
| @@ -61,6 +62,9 @@ class StylePropertyShorthandWriter(in_generator.Writer): |
| longhand = self._create_css_property_name_enum_value(longhand) |
| property["camel_case_longhands"].append(longhand) |
| self._longhand_dictionary[longhand].append(property) |
| + if property["runtimeConditional"] is not None: |
| + lowerFirstConditional = self._lower_first(property["runtimeConditional"]) |
| + property["runtime_conditional_getter"] = "%sEnabled" % lowerFirstConditional |
| self._properties = dict((property["property_id"], property) for property in self._properties) |
| # FIXME: some of these might be better in a utils file |
| @@ -70,6 +74,14 @@ class StylePropertyShorthandWriter(in_generator.Writer): |
| def _create_css_property_name_enum_value(self, property_name): |
| return "CSSProperty" + property_name |
| + def _lower_first(self, string): |
| + lowered = string[0].lower() + string[1:] |
| + lowered = lowered.replace("cSS", "css") |
| + lowered = lowered.replace("iME", "ime") |
| + lowered = lowered.replace("hTML", "html") |
| + lowered = lowered.replace("wOFF", "woff") |
|
Julien - ping for review
2013/08/09 16:47:30
This seems like an overkill to list all these as w
|
| + return lowered |
| + |
| @template_expander.use_jinja("StylePropertyShorthand.cpp.tmpl") |
| def generate_style_property_shorthand_cpp(self): |
| return { |