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

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

Issue 10974015: Hiding getElement* methods on ShadowRoot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporating review feedback. 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/dartium/html_dartium.dart ('k') | no next file » | 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 'DOMFormData': 'FormData', 7 'DOMFormData': 'FormData',
8 'DOMWindow': 'Window', 8 'DOMWindow': 'Window',
9 'WebKitAnimation': 'Animation', 9 'WebKitAnimation': 'Animation',
10 'WebKitAnimationEvent': 'AnimationEvent', 10 'WebKitAnimationEvent': 'AnimationEvent',
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 'EventTarget.removeEventListener', 74 'EventTarget.removeEventListener',
75 'MouseEvent.initMouseEvent', 75 'MouseEvent.initMouseEvent',
76 'Node.appendChild', 76 'Node.appendChild',
77 'Node.attributes', 77 'Node.attributes',
78 'Node.childNodes', 78 'Node.childNodes',
79 'Node.firstChild', 79 'Node.firstChild',
80 'Node.lastChild', 80 'Node.lastChild',
81 "Node.nodeType", 81 "Node.nodeType",
82 'Node.removeChild', 82 'Node.removeChild',
83 'Node.replaceChild', 83 'Node.replaceChild',
84 'ShadowRoot.getElementById',
85 'ShadowRoot.getElementsByClassName',
86 'ShadowRoot.getElementsByTagName',
84 'Storage.length', 87 'Storage.length',
85 'Storage.clear', 88 'Storage.clear',
86 'Storage.getItem', 89 'Storage.getItem',
87 'Storage.key', 90 'Storage.key',
88 'Storage.removeItem', 91 'Storage.removeItem',
89 'Storage.setItem', 92 'Storage.setItem',
90 'Window.getComputedStyle', 93 'Window.getComputedStyle',
91 ]) 94 ])
92 95
93 # Members from the standard dom that exist in the dart:html library with 96 # Members from the standard dom that exist in the dart:html library with
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 "Node.get:DOCUMENT_POSITION_CONTAINED_BY", 261 "Node.get:DOCUMENT_POSITION_CONTAINED_BY",
259 "Node.get:prefix", 262 "Node.get:prefix",
260 "Node.set:prefix", 263 "Node.set:prefix",
261 "Node.get:DOCUMENT_POSITION_PRECEDING", 264 "Node.get:DOCUMENT_POSITION_PRECEDING",
262 "Node.get:nodeValue", 265 "Node.get:nodeValue",
263 "Node.set:nodeValue", 266 "Node.set:nodeValue",
264 "Node.get:CDATA_SECTION_NODE", 267 "Node.get:CDATA_SECTION_NODE",
265 "Node.get:nodeName", 268 "Node.get:nodeName",
266 "Node.lookupPrefix", 269 "Node.lookupPrefix",
267 "Node.get:PROCESSING_INSTRUCTION_NODE", 270 "Node.get:PROCESSING_INSTRUCTION_NODE",
271 'ShadowRoot.getElementsByTagNameNS',
268 "IFrameElement.get:contentDocument", 272 "IFrameElement.get:contentDocument",
269 "Window.get:frameElement", 273 "Window.get:frameElement",
270 ]) 274 ])
271 275
272 class HtmlRenamer(object): 276 class HtmlRenamer(object):
273 def __init__(self, database): 277 def __init__(self, database):
274 self._database = database 278 self._database = database
275 279
276 def RenameInterface(self, interface): 280 def RenameInterface(self, interface):
277 if interface.id.startswith('HTML'): 281 if interface.id.startswith('HTML'):
(...skipping 24 matching lines...) Expand all
302 306
303 def _FindMatch(self, interface, member, member_prefix, candidates): 307 def _FindMatch(self, interface, member, member_prefix, candidates):
304 for interface in self._database.Hierarchy(interface): 308 for interface in self._database.Hierarchy(interface):
305 html_interface_name = self.RenameInterface(interface) 309 html_interface_name = self.RenameInterface(interface)
306 member_name = html_interface_name + '.' + member 310 member_name = html_interface_name + '.' + member
307 if member_name in candidates: 311 if member_name in candidates:
308 return member_name 312 return member_name
309 member_name = html_interface_name + '.' + member_prefix + member 313 member_name = html_interface_name + '.' + member_prefix + member
310 if member_name in candidates: 314 if member_name in candidates:
311 return member_name 315 return member_name
OLDNEW
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698