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

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: Address comments Created 3 years, 10 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 70fa6fe7b3e23cb483cf86fd46a8eb1689cc7f48..2f2f84f8b0a5a85ef7683a4e2a3da410df3fec50 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
@@ -87,6 +87,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), \
+ ("'" + property_['name'] + "' can't have type_name '" + enum_name + "' "
+ "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