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

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

Issue 1691883003: Deprecate SVGZoomEvent and SVGZoomEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update -expected files with deprecation messages and rename counter to SVGZoomEvent Created 4 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
Index: third_party/WebKit/Source/build/scripts/make_event_factory.py
diff --git a/third_party/WebKit/Source/build/scripts/make_event_factory.py b/third_party/WebKit/Source/build/scripts/make_event_factory.py
index 7a9d9c28e02cf12d0c26a3ef4abef78dc00650e2..9ffcfb0b3730b55d1cc40212c9ab305017798912 100755
--- a/third_party/WebKit/Source/build/scripts/make_event_factory.py
+++ b/third_party/WebKit/Source/build/scripts/make_event_factory.py
@@ -47,12 +47,16 @@ HEADER_TEMPLATE = """%(license)s
"""
-# The list is a close match to:
+# All events on the following whitelist are matched case-insensitively
+# in createEvent.
#
-# https://dom.spec.whatwg.org/#dom-document-createevent
+# All events not on the list are being measured (except for already
+# deprecated ones). The plan is to limit createEvent to just a few
+# selected events necessary for legacy content in accordance with the
+# specification:
#
-# with the exepction for |keyevents| not present in Blink.
-def case_insensitive_matching(name):
+# https://dom.spec.whatwg.org/#dom-document-createevent
+def create_event_whitelist(name):
return (name == ('HTMLEvents')
or name == 'Event'
or name == 'Events'
@@ -64,21 +68,21 @@ def case_insensitive_matching(name):
or name == 'TouchEvent')
-# All events not on the following whitelist are being measured in
-# createEvent. The plan is to limit createEvent to just a few selected
-# events necessary for legacy content in accordance with the
-# specification:
-#
-# https://dom.spec.whatwg.org/#dom-document-createevent
-def candidate_whitelist(name):
- return (case_insensitive_matching(name)
- or name == 'SVGZoomEvent' # Will be deprecated instead.
- or name == 'SVGZoomEvents') # Will be deprecated instead.
+def create_event_deprecate_list(name):
+ return (name == 'SVGZoomEvent'
+ or name == 'SVGZoomEvents')
def measure_name(name):
return 'DocumentCreateEvent' + name
+
+def deprecate_name(name):
+ if (name.startswith('SVGZoomEvent')):
+ return 'SVGZoomEvent'
+ return None
+
+
class EventFactoryWriter(in_generator.Writer):
defaults = {
'ImplementedAs': None,
@@ -92,10 +96,11 @@ class EventFactoryWriter(in_generator.Writer):
filters = {
'cpp_name': name_utilities.cpp_name,
'lower_first': name_utilities.lower_first,
- 'case_insensitive_matching': case_insensitive_matching,
'script_name': name_utilities.script_name,
- 'candidate_whitelist': candidate_whitelist,
+ 'create_event_whitelist': create_event_whitelist,
+ 'create_event_deprecate_list': create_event_deprecate_list,
'measure_name': measure_name,
+ 'deprecate_name': deprecate_name,
}
def __init__(self, in_file_path):

Powered by Google App Engine
This is Rietveld 408576698