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

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

Issue 11642035: Renaming Window to WindowBase and LocalWindow to Window. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « sdk/lib/html/scripts/htmldartgenerator.py ('k') | sdk/lib/html/src/CrossFrameTypes.dart » ('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 import re 5 import re
6 6
7 html_interface_renames = { 7 html_interface_renames = {
8 'CDATASection': 'CDataSection', 8 'CDATASection': 'CDataSection',
9 'DOMApplicationCache': 'ApplicationCache', 9 'DOMApplicationCache': 'ApplicationCache',
10 'DOMCoreException': 'DomException', 10 'DOMCoreException': 'DomException',
11 'DOMFileSystem': 'FileSystem', 11 'DOMFileSystem': 'FileSystem',
12 'DOMFileSystemSync': 'FileSystemSync', 12 'DOMFileSystemSync': 'FileSystemSync',
13 'DOMFormData': 'FormData', 13 'DOMFormData': 'FormData',
14 'DOMURL': 'Url', 14 'DOMURL': 'Url',
15 'DOMWindow': 'LocalWindow', 15 'DOMWindow': 'Window',
16 'History': 'LocalHistory',
17 'HTMLDocument' : 'HtmlDocument', 16 'HTMLDocument' : 'HtmlDocument',
18 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium. 17 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium.
19 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. 18 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts.
20 'Location': 'LocalLocation',
21 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. 19 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts.
22 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. 20 'SVGElement': 'SvgElement', # Manual to avoid name conflicts.
23 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. 21 'SVGException': 'SvgException', # Manual of avoid conflict with Exception.
24 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. 22 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts.
25 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject', 23 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject',
26 'WebKitAnimation': 'Animation', 24 'WebKitAnimation': 'Animation',
27 'WebKitAnimationEvent': 'AnimationEvent', 25 'WebKitAnimationEvent': 'AnimationEvent',
28 'WebKitBlobBuilder': 'BlobBuilder', 26 'WebKitBlobBuilder': 'BlobBuilder',
29 'WebKitCSSKeyframeRule': 'CssKeyframeRule', 27 'WebKitCSSKeyframeRule': 'CssKeyframeRule',
30 'WebKitCSSKeyframesRule': 'CssKeyframesRule', 28 'WebKitCSSKeyframesRule': 'CssKeyframesRule',
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 'ElementTraversal.childElementCount', 101 'ElementTraversal.childElementCount',
104 'ElementTraversal.firstElementChild', 102 'ElementTraversal.firstElementChild',
105 'ElementTraversal.lastElementChild', 103 'ElementTraversal.lastElementChild',
106 'Event.initEvent', 104 'Event.initEvent',
107 'UIEvent.initUIEvent', 105 'UIEvent.initUIEvent',
108 'EventTarget.addEventListener', 106 'EventTarget.addEventListener',
109 'EventTarget.dispatchEvent', 107 'EventTarget.dispatchEvent',
110 'EventTarget.removeEventListener', 108 'EventTarget.removeEventListener',
111 'KeyboardEvent.keyIdentifier', 109 'KeyboardEvent.keyIdentifier',
112 'KeyboardEvent.initKeyboardEvent', 110 'KeyboardEvent.initKeyboardEvent',
113 'LocalWindow.getComputedStyle', 111 'Window.getComputedStyle',
sra1 2012/12/20 02:19:18 Move to keep sorted.
Emily Fortuna 2012/12/20 18:26:23 +1
114 'MouseEvent.initMouseEvent', 112 'MouseEvent.initMouseEvent',
115 'Node.appendChild', 113 'Node.appendChild',
116 'Node.attributes', 114 'Node.attributes',
117 'Node.childNodes', 115 'Node.childNodes',
118 'Node.firstChild', 116 'Node.firstChild',
119 'Node.lastChild', 117 'Node.lastChild',
120 "Node.localName", 118 "Node.localName",
121 'Node.namespaceURI', 119 'Node.namespaceURI',
122 'Node.removeChild', 120 'Node.removeChild',
123 'Node.replaceChild', 121 'Node.replaceChild',
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 "Node.get:prefix", 312 "Node.get:prefix",
315 "Node.set:prefix", 313 "Node.set:prefix",
316 "Node.get:DOCUMENT_POSITION_PRECEDING", 314 "Node.get:DOCUMENT_POSITION_PRECEDING",
317 "Node.get:nodeValue", 315 "Node.get:nodeValue",
318 "Node.set:nodeValue", 316 "Node.set:nodeValue",
319 "Node.get:CDATA_SECTION_NODE", 317 "Node.get:CDATA_SECTION_NODE",
320 "Node.get:nodeName", 318 "Node.get:nodeName",
321 "Node.lookupPrefix", 319 "Node.lookupPrefix",
322 "Node.get:PROCESSING_INSTRUCTION_NODE", 320 "Node.get:PROCESSING_INSTRUCTION_NODE",
323 'ShadowRoot.getElementsByTagNameNS', 321 'ShadowRoot.getElementsByTagNameNS',
324 "LocalWindow.blur", 322 "Window.blur",
325 "LocalWindow.clientInformation", 323 "Window.clientInformation",
326 "LocalWindow.get:frames", 324 "Window.get:frames",
327 "LocalWindow.get:length", 325 "Window.get:length",
328 "LocalWindow.focus", 326 "Window.focus",
329 "LocalWindow.prompt", 327 "Window.prompt",
330 "LocalWindow.webkitIndexedDB", 328 "Window.webkitIndexedDB",
331 "LocalWindow.webkitCancelRequestAnimationFrame", 329 "Window.webkitCancelRequestAnimationFrame",
332 "WheelEvent.wheelDelta", 330 "WheelEvent.wheelDelta",
333 "WorkerContext.webkitIndexedDB", 331 "WorkerContext.webkitIndexedDB",
334 ]) 332 ])
335 333
336 class HtmlRenamer(object): 334 class HtmlRenamer(object):
337 def __init__(self, database): 335 def __init__(self, database):
338 self._database = database 336 self._database = database
339 337
340 def RenameInterface(self, interface): 338 def RenameInterface(self, interface):
341 if interface.id in html_interface_renames: 339 if interface.id in html_interface_renames:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 413
416 # We're looking for a sequence of letters which start with capital letter 414 # We're looking for a sequence of letters which start with capital letter
417 # then a series of caps and finishes with either the end of the string or 415 # then a series of caps and finishes with either the end of the string or
418 # a capital letter. 416 # a capital letter.
419 # The [0-9] check is for names such as 2D or 3D 417 # The [0-9] check is for names such as 2D or 3D
420 # The following test cases should match as: 418 # The following test cases should match as:
421 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 419 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
422 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 420 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
423 # IFrameElement: (I)()(F)rameElement (no change) 421 # IFrameElement: (I)()(F)rameElement (no change)
424 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 422 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW
« no previous file with comments | « sdk/lib/html/scripts/htmldartgenerator.py ('k') | sdk/lib/html/src/CrossFrameTypes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698