Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: third_party/WebKit/Source/build/scripts/css_properties.py

Issue 2756113002: Move naming related code in make_computed_style_base to name_utilities. (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/make_computed_style_base.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/css_properties.py
diff --git a/third_party/WebKit/Source/build/scripts/css_properties.py b/third_party/WebKit/Source/build/scripts/css_properties.py
index 1a798a70921e63bea8d0440cb018461f0078cee2..98636a7f891f66c6d1796ffa28406e811eadbdca 100755
--- a/third_party/WebKit/Source/build/scripts/css_properties.py
+++ b/third_party/WebKit/Source/build/scripts/css_properties.py
@@ -4,7 +4,9 @@
# found in the LICENSE file.
import json5_generator
-import name_utilities
+from name_utilities import (
+ upper_camel_case, lower_camel_case, enum_for_css_property, enum_for_css_property_alias
+)
class CSSProperties(json5_generator.Writer):
@@ -47,9 +49,9 @@ class CSSProperties(json5_generator.Writer):
' or both'
for offset, property in enumerate(properties):
- property['property_id'] = name_utilities.enum_for_css_property(property['name'])
- property['upper_camel_name'] = name_utilities.camel_case(property['name'])
- property['lower_camel_name'] = name_utilities.lower_first(property['upper_camel_name'])
+ property['property_id'] = enum_for_css_property(property['name'])
+ property['upper_camel_name'] = upper_camel_case(property['name'])
+ property['lower_camel_name'] = lower_camel_case(property['name'])
property['enum_value'] = self._first_enum_value + offset
property['is_internal'] = property['name'].startswith('-internal-')
@@ -62,17 +64,14 @@ class CSSProperties(json5_generator.Writer):
# Update property aliases to include the fields of the property being aliased.
for i, alias in enumerate(self._aliases):
aliased_property = self._properties[
- name_utilities.enum_for_css_property(alias['alias_for'])]
+ enum_for_css_property(alias['alias_for'])]
updated_alias = aliased_property.copy()
updated_alias['name'] = alias['name']
updated_alias['alias_for'] = alias['alias_for']
- updated_alias['property_id'] = \
- name_utilities.enum_for_css_property_alias(alias['name'])
+ updated_alias['property_id'] = enum_for_css_property_alias(alias['name'])
updated_alias['enum_value'] = aliased_property['enum_value'] + 512
- updated_alias['upper_camel_name'] = \
- name_utilities.camel_case(alias['name'])
- updated_alias['lower_camel_name'] = \
- name_utilities.lower_first(updated_alias['upper_camel_name'])
+ updated_alias['upper_camel_name'] = upper_camel_case(alias['name'])
+ updated_alias['lower_camel_name'] = lower_camel_case(alias['name'])
self._aliases[i] = updated_alias
self._properties_including_aliases += self._aliases
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/make_computed_style_base.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698