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

Side by Side Diff: third_party/WebKit/Source/build/scripts/make_event_factory.py

Issue 2133983003: Remove SVGZoomEvent interface and onzoom attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 or name == 'Event' 61 or name == 'Event'
62 or name == 'Events' 62 or name == 'Events'
63 or name.startswith('UIEvent') 63 or name.startswith('UIEvent')
64 or name.startswith('CustomEvent') 64 or name.startswith('CustomEvent')
65 or name == 'KeyboardEvent' 65 or name == 'KeyboardEvent'
66 or name == 'MessageEvent' 66 or name == 'MessageEvent'
67 or name.startswith('MouseEvent') 67 or name.startswith('MouseEvent')
68 or name == 'TouchEvent') 68 or name == 'TouchEvent')
69 69
70 70
71 def create_event_deprecate_list(name):
72 return (name == 'SVGZoomEvent'
73 or name == 'SVGZoomEvents')
74
75
76 def measure_name(name): 71 def measure_name(name):
77 return 'DocumentCreateEvent' + name 72 return 'DocumentCreateEvent' + name
78 73
79 74
80 def deprecate_name(name):
81 if (name.startswith('SVGZoomEvent')):
82 return 'SVGZoomEvent'
83 return None
84
85
86 class EventFactoryWriter(in_generator.Writer): 75 class EventFactoryWriter(in_generator.Writer):
87 defaults = { 76 defaults = {
88 'ImplementedAs': None, 77 'ImplementedAs': None,
89 'RuntimeEnabled': None, 78 'RuntimeEnabled': None,
90 } 79 }
91 default_parameters = { 80 default_parameters = {
92 'export': '', 81 'export': '',
93 'namespace': '', 82 'namespace': '',
94 'suffix': '', 83 'suffix': '',
95 } 84 }
96 filters = { 85 filters = {
97 'cpp_name': name_utilities.cpp_name, 86 'cpp_name': name_utilities.cpp_name,
98 'lower_first': name_utilities.lower_first, 87 'lower_first': name_utilities.lower_first,
99 'script_name': name_utilities.script_name, 88 'script_name': name_utilities.script_name,
100 'create_event_whitelist': create_event_whitelist, 89 'create_event_whitelist': create_event_whitelist,
101 'create_event_deprecate_list': create_event_deprecate_list,
102 'measure_name': measure_name, 90 'measure_name': measure_name,
103 'deprecate_name': deprecate_name,
104 } 91 }
105 92
106 def __init__(self, in_file_path): 93 def __init__(self, in_file_path):
107 super(EventFactoryWriter, self).__init__(in_file_path) 94 super(EventFactoryWriter, self).__init__(in_file_path)
108 self.namespace = self.in_file.parameters['namespace'].strip('"') 95 self.namespace = self.in_file.parameters['namespace'].strip('"')
109 self.suffix = self.in_file.parameters['suffix'].strip('"') 96 self.suffix = self.in_file.parameters['suffix'].strip('"')
110 self._validate_entries() 97 self._validate_entries()
111 self._outputs = {(self.namespace + self.suffix + "Headers.h"): self.gene rate_headers_header, 98 self._outputs = {(self.namespace + self.suffix + "Headers.h"): self.gene rate_headers_header,
112 (self.namespace + self.suffix + ".cpp"): self.generate_ implementation, 99 (self.namespace + self.suffix + ".cpp"): self.generate_ implementation,
113 } 100 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 def generate_implementation(self): 161 def generate_implementation(self):
175 return { 162 return {
176 'namespace': self.namespace, 163 'namespace': self.namespace,
177 'suffix': self.suffix, 164 'suffix': self.suffix,
178 'events': self.in_file.name_dictionaries, 165 'events': self.in_file.name_dictionaries,
179 } 166 }
180 167
181 168
182 if __name__ == "__main__": 169 if __name__ == "__main__":
183 in_generator.Maker(EventFactoryWriter).main(sys.argv) 170 in_generator.Maker(EventFactoryWriter).main(sys.argv)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698