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

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

Issue 2742263002: Add 'storage_only' template to make_computed_style_base.py. (Closed)
Patch Set: Add missing file 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/templates/ComputedStyleBase.h.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/make_computed_style_base.py
diff --git a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
index 735b6840ef81ade887e065ef1a62beb62de55ed0..08093660e6ebb3e800a676d7a37ed93f3f614d0e 100755
--- a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
+++ b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
@@ -27,7 +27,10 @@ NONPROPERTY_FIELDS = [
# A non-inherited property references a variable or @apply is used
{'name': 'hasVariableReferenceFromNonInheritedProperty', 'field_template': 'monotonic_flag'},
# Explicitly inherits a non-inherited property
- {'name': 'hasExplicitlyInheritedProperties', 'field_template': 'monotonic_flag'}
+ {'name': 'hasExplicitlyInheritedProperties', 'field_template': 'monotonic_flag'},
+ # These properties only have generated storage, and their methods are handwritten in ComputedStyle.
+ # TODO(shend): Remove these fields and delete the 'storage_only' template.
+ {'name': 'emptyState', 'field_template': 'storage_only', 'size': 1}
]
@@ -206,18 +209,25 @@ def _create_nonproperty_field(property_):
Create a nonproperty field from an entry in NONPROPERTY_FIELDS and return the Field object.
"""
# TODO(shend): Make this work for nonflags
- assert property_['field_template'] in ('flag', 'monotonic_flag'), \
+ assert property_['field_template'] in ('flag', 'monotonic_flag', 'storage_only'), \
"Nonproperties with arbitrary templates are not yet supported"
member_name = 'm_' + property_['name']
field_name_upper = upper_first_letter(property_['name'])
+ if property_['field_template'] == 'storage_only':
+ assert 'size' in property_, 'storage_only fields need to specify a size'
+ size = property_['size']
+ else:
+ # Otherwise the field must be some type of flag.
+ size = 1
+
return Field(
'nonproperty',
name=member_name,
property_name=property_['name'],
type_name='bool',
field_template=property_['field_template'],
- size=1,
+ size=size,
default_value='false',
getter_method_name=property_['name'],
setter_method_name='set' + field_name_upper,
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698