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

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

Issue 2785013002: Add utility for joining names in generated code. (Closed)
Patch Set: 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
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 174941950ab6248421308683cec646ce9470580b..74e8389eafc65053fff9213172e16621ef4f9ae6 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
@@ -11,7 +11,8 @@ import template_expander
import make_style_builder
from name_utilities import (
- enum_for_css_keyword, enum_type_name, enum_value_name, class_member_name, method_name
+ enum_for_css_keyword, enum_type_name, enum_value_name, class_member_name, method_name,
+ join_name
)
@@ -113,14 +114,14 @@ class Field(object):
self.is_independent = kwargs.pop('independent')
assert self.is_inherited or not self.is_independent, 'Only inherited fields can be independent'
- self.is_inherited_method_name = method_name(name_for_methods + 'IsInherited')
+ self.is_inherited_method_name = method_name(join_name(name_for_methods, 'is inherited'))
# Method names
getter_prefix = 'Get' if name_for_methods == self.type_name else ''
- self.getter_method_name = method_name(getter_prefix + name_for_methods)
- self.setter_method_name = method_name('Set' + name_for_methods)
- self.initial_method_name = method_name('Initial' + name_for_methods)
- self.resetter_method_name = method_name('Reset' + name_for_methods)
+ self.getter_method_name = method_name(join_name(getter_prefix, name_for_methods))
+ self.setter_method_name = method_name(join_name('set', name_for_methods))
+ self.initial_method_name = method_name(join_name('initial', name_for_methods))
+ self.resetter_method_name = method_name(join_name('reset', name_for_methods))
assert len(kwargs) == 0, 'Unexpected arguments provided to Field: ' + str(kwargs)
@@ -205,7 +206,7 @@ def _create_inherited_flag_field(property_):
"""
return Field(
'inherited_flag',
- property_['name_for_methods'] + 'IsInherited',
+ join_name(property_['name_for_methods'], 'is inherited'),
property_name=property_['name'],
type_name='bool',
field_template='flag',

Powered by Google App Engine
This is Rietveld 408576698