Commit 8419b1ac authored by timloh@chromium.org's avatar timloh@chromium.org

Fix _first_enum_value usage on make_css_property_names.py

This patch fixes make_css_property_names.py to use _first_enum_value
where appropriate so that the value can be updated in the future.

Review URL: https://codereview.chromium.org/1310073003

git-svn-id: svn://svn.chromium.org/blink/trunk@201183 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c42408e2
...@@ -52,11 +52,12 @@ class CSSProperties(in_generator.Writer): ...@@ -52,11 +52,12 @@ class CSSProperties(in_generator.Writer):
self._aliases = [property for property in properties if property['alias_for']] self._aliases = [property for property in properties if property['alias_for']]
properties = [property for property in properties if not property['alias_for']] properties = [property for property in properties if not property['alias_for']]
# StylePropertyMetadata additionally assumes there are under 1024 properties.
assert len(properties) < 512, 'Property aliasing expects there are under 512 properties.'
# We currently assign 0 to CSSPropertyInvalid # We currently assign 0 to CSSPropertyInvalid
self._first_enum_value = 1 self._first_enum_value = 1
# StylePropertyMetadata additionally assumes there are under 1024 properties.
assert self._first_enum_value + len(properties) < 512, 'Property aliasing expects there are under 512 properties.'
for offset, property in enumerate(properties): for offset, property in enumerate(properties):
property['property_id'] = css_name_to_enum(property['name']) property['property_id'] = css_name_to_enum(property['name'])
property['upper_camel_name'] = camelcase_css_name(property['name']) property['upper_camel_name'] = camelcase_css_name(property['name'])
......
...@@ -203,7 +203,7 @@ class CSSPropertyNamesWriter(css_properties.CSSProperties): ...@@ -203,7 +203,7 @@ class CSSPropertyNamesWriter(css_properties.CSSProperties):
property_offsets = [] property_offsets = []
property_names = [] property_names = []
current_offset = 0 current_offset = 0
for enum_value in range(1, max(enum_value_to_name) + 1): for enum_value in range(self._first_enum_value, max(enum_value_to_name) + 1):
property_offsets.append(current_offset) property_offsets.append(current_offset)
if enum_value in enum_value_to_name: if enum_value in enum_value_to_name:
name = enum_value_to_name[enum_value] name = enum_value_to_name[enum_value]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment