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

Side by Side Diff: lib/html/scripts/htmlrenamer.py

Issue 11098052: Make WheelEvent.delta{X,Y} return num, not int. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « lib/html/idl/dart/dart.idl ('k') | lib/html/templates/html/impl/impl_WheelEvent.darttemplate » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 html_interface_renames = { 6 html_interface_renames = {
7 'DOMCoreException': 'DOMException', 7 'DOMCoreException': 'DOMException',
8 'DOMFormData': 'FormData', 8 'DOMFormData': 'FormData',
9 'DOMWindow': 'LocalWindow', 9 'DOMWindow': 'LocalWindow',
10 'History': 'LocalHistory', 10 'History': 'LocalHistory',
(...skipping 18 matching lines...) Expand all
29 # Members from the standard dom that should not be exposed publicly in dart:html 29 # Members from the standard dom that should not be exposed publicly in dart:html
30 # but need to be exposed internally to implement dart:html on top of a standard 30 # but need to be exposed internally to implement dart:html on top of a standard
31 # browser. 31 # browser.
32 _private_html_members = set([ 32 _private_html_members = set([
33 'CustomEvent.initCustomEvent', 33 'CustomEvent.initCustomEvent',
34 'Document.createElement', 34 'Document.createElement',
35 'Document.createElementNS', 35 'Document.createElementNS',
36 'Document.createEvent', 36 'Document.createEvent',
37 'Document.createTextNode', 37 'Document.createTextNode',
38 'Document.createTouchList', 38 'Document.createTouchList',
39 'DocumentFragment.querySelector',
40 'DocumentFragment.querySelectorAll',
39 'Document.getElementById', 41 'Document.getElementById',
40 'Document.getElementsByClassName', 42 'Document.getElementsByClassName',
41 'Document.getElementsByName', 43 'Document.getElementsByName',
42 'Document.getElementsByTagName', 44 'Document.getElementsByTagName',
43 'Document.querySelector', 45 'Document.querySelector',
44 'Document.querySelectorAll', 46 'Document.querySelectorAll',
45 'DocumentFragment.querySelector',
46 'DocumentFragment.querySelectorAll',
47 'Element.childElementCount', 47 'Element.childElementCount',
48 'Element.children', 48 'Element.children',
49 'Element.className', 49 'Element.className',
50 'Element.firstElementChild', 50 'Element.firstElementChild',
51 'Element.getAttribute', 51 'Element.getAttribute',
52 'Element.getElementsByClassName', 52 'Element.getElementsByClassName',
53 'Element.getElementsByTagName', 53 'Element.getElementsByTagName',
54 'Element.hasAttribute', 54 'Element.hasAttribute',
55 'Element.lastElementChild', 55 'Element.lastElementChild',
56 'Element.querySelector', 56 'Element.querySelector',
57 'Element.querySelectorAll', 57 'Element.querySelectorAll',
58 'Element.removeAttribute', 58 'Element.removeAttribute',
59 'Element.setAttribute', 59 'Element.setAttribute',
60 'Event.initEvent', 60 'Event.initEvent',
61 'EventTarget.addEventListener', 61 'EventTarget.addEventListener',
62 'EventTarget.dispatchEvent', 62 'EventTarget.dispatchEvent',
63 'EventTarget.removeEventListener', 63 'EventTarget.removeEventListener',
64 'LocalWindow.getComputedStyle',
64 'MouseEvent.initMouseEvent', 65 'MouseEvent.initMouseEvent',
65 'Node.appendChild', 66 'Node.appendChild',
66 'Node.attributes', 67 'Node.attributes',
67 'Node.childNodes', 68 'Node.childNodes',
68 'Node.firstChild', 69 'Node.firstChild',
69 'Node.lastChild', 70 'Node.lastChild',
70 "Node.nodeType", 71 "Node.nodeType",
71 'Node.removeChild', 72 'Node.removeChild',
72 'Node.replaceChild', 73 'Node.replaceChild',
73 'ShadowRoot.getElementById', 74 'ShadowRoot.getElementById',
74 'ShadowRoot.getElementsByClassName', 75 'ShadowRoot.getElementsByClassName',
75 'ShadowRoot.getElementsByTagName', 76 'ShadowRoot.getElementsByTagName',
76 'Storage.length',
77 'Storage.clear', 77 'Storage.clear',
78 'Storage.getItem', 78 'Storage.getItem',
79 'Storage.key', 79 'Storage.key',
80 'Storage.length',
80 'Storage.removeItem', 81 'Storage.removeItem',
81 'Storage.setItem', 82 'Storage.setItem',
82 'LocalWindow.getComputedStyle', 83 'WheelEvent.wheelDeltaX',
84 'WheelEvent.wheelDeltaY',
83 ]) 85 ])
84 86
85 # Members from the standard dom that exist in the dart:html library with 87 # Members from the standard dom that exist in the dart:html library with
86 # identical functionality but with cleaner names. 88 # identical functionality but with cleaner names.
87 _renamed_html_members = { 89 _renamed_html_members = {
88 'Document.defaultView': 'window', 90 'Document.defaultView': 'window',
89 'Element.webkitMatchesSelector' : 'matchesSelector', 91 'Element.webkitMatchesSelector' : 'matchesSelector',
90 'Element.scrollIntoViewIfNeeded': 'scrollIntoView', 92 'Element.scrollIntoViewIfNeeded': 'scrollIntoView',
91 'Node.cloneNode': 'clone', 93 'Node.cloneNode': 'clone',
92 'Node.nextSibling': 'nextNode', 94 'Node.nextSibling': 'nextNode',
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 "Node.get:CDATA_SECTION_NODE", 263 "Node.get:CDATA_SECTION_NODE",
262 "Node.get:nodeName", 264 "Node.get:nodeName",
263 "Node.lookupPrefix", 265 "Node.lookupPrefix",
264 "Node.get:PROCESSING_INSTRUCTION_NODE", 266 "Node.get:PROCESSING_INSTRUCTION_NODE",
265 'ShadowRoot.getElementsByTagNameNS', 267 'ShadowRoot.getElementsByTagNameNS',
266 "IFrameElement.get:contentDocument", 268 "IFrameElement.get:contentDocument",
267 "LocalWindow.get:frameElement", 269 "LocalWindow.get:frameElement",
268 "LocalWindow.get:frames", 270 "LocalWindow.get:frames",
269 "LocalWindow.get:length", 271 "LocalWindow.get:length",
270 "LocalWindow.webkitCancelRequestAnimationFrame", 272 "LocalWindow.webkitCancelRequestAnimationFrame",
273 "WheelEvent.wheelDelta",
271 ]) 274 ])
272 275
273 class HtmlRenamer(object): 276 class HtmlRenamer(object):
274 def __init__(self, database): 277 def __init__(self, database):
275 self._database = database 278 self._database = database
276 279
277 def RenameInterface(self, interface): 280 def RenameInterface(self, interface):
278 if interface.id.startswith('HTML'): 281 if interface.id.startswith('HTML'):
279 if any(interface.id in ['Element', 'Document'] 282 if any(interface.id in ['Element', 'Document']
280 for interface in self._database.Hierarchy(interface)): 283 for interface in self._database.Hierarchy(interface)):
(...skipping 22 matching lines...) Expand all
303 306
304 def _FindMatch(self, interface, member, member_prefix, candidates): 307 def _FindMatch(self, interface, member, member_prefix, candidates):
305 for interface in self._database.Hierarchy(interface): 308 for interface in self._database.Hierarchy(interface):
306 html_interface_name = self.RenameInterface(interface) 309 html_interface_name = self.RenameInterface(interface)
307 member_name = html_interface_name + '.' + member 310 member_name = html_interface_name + '.' + member
308 if member_name in candidates: 311 if member_name in candidates:
309 return member_name 312 return member_name
310 member_name = html_interface_name + '.' + member_prefix + member 313 member_name = html_interface_name + '.' + member_prefix + member
311 if member_name in candidates: 314 if member_name in candidates:
312 return member_name 315 return member_name
OLDNEW
« no previous file with comments | « lib/html/idl/dart/dart.idl ('k') | lib/html/templates/html/impl/impl_WheelEvent.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698