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

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

Issue 415613002: Merge CSSPropertyNames.in and SVGCSSPropertyNames.in with CSSProperties.in (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix crash without experimental flag Created 6 years, 4 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
Index: Source/build/scripts/css_properties.py
diff --git a/Source/build/scripts/css_properties.py b/Source/build/scripts/css_properties.py
index 83f2196354da92aabd215692ec1fcef6216ec9e5..a155a1bba385d852b46b30cdd36d1e9d3f5c8a66 100755
--- a/Source/build/scripts/css_properties.py
+++ b/Source/build/scripts/css_properties.py
@@ -9,6 +9,7 @@ from name_utilities import lower_first
class CSSProperties(in_generator.Writer):
defaults = {
+ 'alias_for': None,
'longhands': '',
'font': False,
'svg': False,
@@ -43,10 +44,18 @@ class CSSProperties(in_generator.Writer):
properties = self.in_file.name_dictionaries
- for property in properties:
+ self._aliases = {property['name']: property['alias_for'] for property in properties if property['alias_for']}
+ properties = [property for property in properties if not property['alias_for']]
+
+ assert len(properties) <= 1024, 'There are more than 1024 CSS Properties, you need to update CSSProperty.h/StylePropertyMetadata m_propertyID accordingly.'
+ # We currently assign 0 to CSSPropertyInvalid
+ self._first_enum_value = 1
+ for offset, property in enumerate(properties):
property['property_id'] = css_name_to_enum(property['name'])
property['upper_camel_name'] = camelcase_css_name(property['name'])
property['lower_camel_name'] = lower_first(property['upper_camel_name'])
+ property['enum_value'] = self._first_enum_value + offset
+ property['is_internal'] = property['name'].startswith('-internal-')
self._properties_list = properties
self._properties = {property['property_id']: property for property in properties}

Powered by Google App Engine
This is Rietveld 408576698