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

Unified Diff: Source/build/scripts/make_event_factory.py

Issue 250933005: Make createEvent do case-insensitive matches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Do not use startsWith for Event(s) Created 6 years, 7 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: Source/build/scripts/make_event_factory.py
diff --git a/Source/build/scripts/make_event_factory.py b/Source/build/scripts/make_event_factory.py
index be8a2a916d38ed33ce7251b49fd41fe1347a4037..16d442c86373f9120879aa6bf897e5ed3d46a559 100755
--- a/Source/build/scripts/make_event_factory.py
+++ b/Source/build/scripts/make_event_factory.py
@@ -37,6 +37,14 @@ import name_utilities
import template_expander
+def case_insensitive_matching(name):
+ return (name == ('HTMLEvents')
+ or name == 'Event'
+ or name == 'Events'
+ or name.startswith('UIEvent')
+ or name.startswith('CustomEvent')
+ or name.startswith('MouseEvent'))
+
class EventFactoryWriter(name_macros.Writer):
defaults = {
'ImplementedAs': None,
@@ -50,6 +58,7 @@ class EventFactoryWriter(name_macros.Writer):
'cpp_name': name_utilities.cpp_name,
'enable_conditional': name_utilities.enable_conditional_if_endif,
'lower_first': name_utilities.lower_first,
+ 'case_insensitive_matching': case_insensitive_matching,
'script_name': name_utilities.script_name,
}
« no previous file with comments | « LayoutTests/fast/events/event-creation-expected.txt ('k') | Source/build/scripts/templates/EventFactory.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698