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

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

Issue 2669973002: Support generating enums shared by multiple ComputedStyle fields. (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | 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 4c8b27ced7a3fddc5c0501bb3344a28959ebb64d..6182207b1c3bc0ae8ecdffa1f663e2445d4e6290 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
@@ -88,6 +88,14 @@ def _create_enums(properties):
enum_name = property_['type_name']
# From the Blink style guide: Enum members should use InterCaps with an initial capital letter. [names-enum-members]
enum_values = [('k' + camel_case(k)) for k in property_['keywords']]
+
+ if enum_name in enums:
+ # There's an enum with the same name, check if the enum values are the same
+ assert set(enums[enum_name]) == set(enum_values), \
+ ("'{}' can't have type_name '{}' ".format(property_['name'], enum_name) +
sashab 2017/02/07 02:59:27 Can you just use + property['name'] and + enum_nam
shend 2017/02/07 21:44:02 done.
+ "because it was used by a previous property, but with a different set of keywords. "
+ "Either give it a different name or ensure the keywords are the same.")
+
enums[enum_name] = enum_values
return enums
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698