| OLD | NEW |
| 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 logging | 5 import logging |
| 6 import monitored | 6 import monitored |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { | 9 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { |
| 10 'CDATASection': 'CDataSection', | 10 'CDATASection': 'CDataSection', |
| 11 'DOMApplicationCache': 'ApplicationCache', | 11 'DOMApplicationCache': 'ApplicationCache', |
| 12 'DOMCoreException': 'DomException', | 12 'DOMCoreException': 'DomException', |
| 13 'DOMFileSystem': 'FileSystem', | 13 'DOMFileSystem': 'FileSystem', |
| 14 'DOMFileSystemSync': 'FileSystemSync', | 14 'DOMFileSystemSync': 'FileSystemSync', |
| 15 'DOMFormData': 'FormData', | 15 'DOMFormData': 'FormData', |
| 16 'DOMURL': 'Url', | 16 'DOMURL': 'Url', |
| 17 'DOMWindow': 'Window', | 17 'DOMWindow': 'Window', |
| 18 'HTMLDocument' : 'HtmlDocument', | 18 'HTMLDocument' : 'HtmlDocument', |
| 19 'HTMLDirectoryElement' : '_DirectoryElement', | 19 'HTMLDirectoryElement' : '_DirectoryElement', |
| 20 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium. | 20 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium. |
| 21 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. | 21 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. |
| 22 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. | 22 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. |
| 23 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. | 23 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. |
| 24 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. | 24 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. |
| 25 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. | 25 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. |
| 26 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject', | 26 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject', |
| 27 'WebKitAnimation': 'Animation', | |
| 28 'WebKitAnimationEvent': 'AnimationEvent', | 27 'WebKitAnimationEvent': 'AnimationEvent', |
| 29 'WebKitCSSKeyframeRule': 'CssKeyframeRule', | 28 'WebKitCSSKeyframeRule': 'CssKeyframeRule', |
| 30 'WebKitCSSKeyframesRule': 'CssKeyframesRule', | 29 'WebKitCSSKeyframesRule': 'CssKeyframesRule', |
| 31 'WebKitCSSMatrix': 'CssMatrix', | 30 'WebKitCSSMatrix': 'CssMatrix', |
| 32 'WebKitCSSTransformValue': 'CssTransformValue', | 31 'WebKitCSSTransformValue': 'CssTransformValue', |
| 33 'WebKitPoint': 'Point', | 32 'WebKitPoint': 'Point', |
| 34 'WebKitTransitionEvent': 'TransitionEvent', | 33 'WebKitTransitionEvent': 'TransitionEvent', |
| 35 'XMLHttpRequest': 'HttpRequest', | 34 'XMLHttpRequest': 'HttpRequest', |
| 36 'XMLHttpRequestException': 'HttpRequestException', | 35 'XMLHttpRequestException': 'HttpRequestException', |
| 37 'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent', | 36 'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent', |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 'WheelEvent.wheelDeltaX', | 131 'WheelEvent.wheelDeltaX', |
| 133 'WheelEvent.wheelDeltaY', | 132 'WheelEvent.wheelDeltaY', |
| 134 'DOMWindow.getComputedStyle', | 133 'DOMWindow.getComputedStyle', |
| 135 ]) | 134 ]) |
| 136 | 135 |
| 137 # Members from the standard dom that exist in the dart:html library with | 136 # Members from the standard dom that exist in the dart:html library with |
| 138 # identical functionality but with cleaner names. | 137 # identical functionality but with cleaner names. |
| 139 _renamed_html_members = monitored.Dict('htmlrenamer._renamed_html_members', { | 138 _renamed_html_members = monitored.Dict('htmlrenamer._renamed_html_members', { |
| 140 'DOMURL.createObjectURL': 'createObjectUrl', | 139 'DOMURL.createObjectURL': 'createObjectUrl', |
| 141 'DOMURL.revokeObjectURL': 'revokeObjectUrl', | 140 'DOMURL.revokeObjectURL': 'revokeObjectUrl', |
| 141 'DOMWindow.webkitNotifications': 'notifications', |
| 142 'DOMWindow.webkitRequestFileSystem': 'requestFileSystem', |
| 143 'DOMWindow.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', |
| 142 'DOMWindow.webkitRequestFileSystem': 'requestFileSystem', | 144 'DOMWindow.webkitRequestFileSystem': 'requestFileSystem', |
| 143 'DOMWindow.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', | 145 'DOMWindow.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', |
| 144 'Document.createCDATASection': 'createCDataSection', | 146 'Document.createCDATASection': 'createCDataSection', |
| 145 'Document.defaultView': 'window', | 147 'Document.defaultView': 'window', |
| 146 'Element.scrollIntoViewIfNeeded': 'scrollIntoView', | 148 'Element.scrollIntoViewIfNeeded': 'scrollIntoView', |
| 147 'Element.webkitCreateShadowRoot': 'createShadowRoot', | 149 'Element.webkitCreateShadowRoot': 'createShadowRoot', |
| 148 'Element.webkitMatchesSelector' : 'matches', | 150 'Element.webkitMatchesSelector' : 'matches', |
| 149 'Node.cloneNode': 'clone', | 151 'Node.cloneNode': 'clone', |
| 150 'Node.nextSibling': 'nextNode', | 152 'Node.nextSibling': 'nextNode', |
| 151 'Node.ownerDocument': 'document', | 153 'Node.ownerDocument': 'document', |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 'Document.releaseEvents', | 240 'Document.releaseEvents', |
| 239 'Document.set:domain', | 241 'Document.set:domain', |
| 240 'Document.vlinkColor', | 242 'Document.vlinkColor', |
| 241 'Document.webkitCurrentFullScreenElement', | 243 'Document.webkitCurrentFullScreenElement', |
| 242 'Document.webkitFullScreenKeyboardInputAllowed', | 244 'Document.webkitFullScreenKeyboardInputAllowed', |
| 243 'Document.write', | 245 'Document.write', |
| 244 'Document.writeln', | 246 'Document.writeln', |
| 245 'Document.xmlStandalone', | 247 'Document.xmlStandalone', |
| 246 'Document.xmlVersion', | 248 'Document.xmlVersion', |
| 247 'DocumentType.*', | 249 'DocumentType.*', |
| 250 'DOMCoreException.code', |
| 251 'DOMCoreException.ABORT_ERR', |
| 252 'DOMCoreException.DATA_CLONE_ERR', |
| 253 'DOMCoreException.DOMSTRING_SIZE_ERR', |
| 254 'DOMCoreException.HIERARCHY_REQUEST_ERR', |
| 255 'DOMCoreException.INDEX_SIZE_ERR', |
| 256 'DOMCoreException.INUSE_ATTRIBUTE_ERR', |
| 257 'DOMCoreException.INVALID_ACCESS_ERR', |
| 258 'DOMCoreException.INVALID_CHARACTER_ERR', |
| 259 'DOMCoreException.INVALID_MODIFICATION_ERR', |
| 260 'DOMCoreException.INVALID_NODE_TYPE_ERR', |
| 261 'DOMCoreException.INVALID_STATE_ERR', |
| 262 'DOMCoreException.NAMESPACE_ERR', |
| 263 'DOMCoreException.NETWORK_ERR', |
| 264 'DOMCoreException.NOT_FOUND_ERR', |
| 265 'DOMCoreException.NOT_SUPPORTED_ERR', |
| 266 'DOMCoreException.NO_DATA_ALLOWED_ERR', |
| 267 'DOMCoreException.NO_MODIFICATION_ALLOWED_ERR', |
| 268 'DOMCoreException.QUOTA_EXCEEDED_ERR', |
| 269 'DOMCoreException.SECURITY_ERR', |
| 270 'DOMCoreException.SYNTAX_ERR', |
| 271 'DOMCoreException.TIMEOUT_ERR', |
| 272 'DOMCoreException.TYPE_MISMATCH_ERR', |
| 273 'DOMCoreException.URL_MISMATCH_ERR', |
| 274 'DOMCoreException.VALIDATION_ERR', |
| 275 'DOMCoreException.WRONG_DOCUMENT_ERR', |
| 248 'Element.accessKey', | 276 'Element.accessKey', |
| 249 'Element.get:classList', | 277 'Element.get:classList', |
| 250 'Element.getAttributeNode', | 278 'Element.getAttributeNode', |
| 251 'Element.getAttributeNodeNS', | 279 'Element.getAttributeNodeNS', |
| 252 'Element.getElementsByTagNameNS', | 280 'Element.getElementsByTagNameNS', |
| 253 'Element.innerText', | 281 'Element.innerText', |
| 254 'Element.outerText', | 282 'Element.outerText', |
| 255 'Element.removeAttributeNode', | 283 'Element.removeAttributeNode', |
| 256 'Element.scrollIntoView', | 284 'Element.scrollIntoView', |
| 257 'Element.set:outerHTML', | 285 'Element.set:outerHTML', |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 516 |
| 489 # We're looking for a sequence of letters which start with capital letter | 517 # We're looking for a sequence of letters which start with capital letter |
| 490 # then a series of caps and finishes with either the end of the string or | 518 # then a series of caps and finishes with either the end of the string or |
| 491 # a capital letter. | 519 # a capital letter. |
| 492 # The [0-9] check is for names such as 2D or 3D | 520 # The [0-9] check is for names such as 2D or 3D |
| 493 # The following test cases should match as: | 521 # The following test cases should match as: |
| 494 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 522 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 495 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 523 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 496 # IFrameElement: (I)()(F)rameElement (no change) | 524 # IFrameElement: (I)()(F)rameElement (no change) |
| 497 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 525 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |