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

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: 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
« no previous file with comments | « no previous file | Source/build/scripts/make_css_property_names.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a500f400d1acff61fc7f372dd8204e5e0c8e0b6d 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,
@@ -24,6 +25,7 @@ class CSSProperties(in_generator.Writer):
'custom_inherit': False,
'custom_value': False,
'builder_skip': False,
+ 'builder_unreachable': False,
alancutter (OOO until 2018) 2014/08/11 05:02:22 Unused flag.
Timothy Loh 2014/08/12 01:49:42 Done.
'direction_aware': False,
}
@@ -35,6 +37,7 @@ class CSSProperties(in_generator.Writer):
'custom_inherit': (True, False),
'custom_value': (True, False),
'builder_skip': (True, False),
+ 'builder_unreachable': (True, False),
'direction_aware': (True, False),
}
@@ -43,10 +46,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}
« no previous file with comments | « no previous file | Source/build/scripts/make_css_property_names.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698