| 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', |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 'CompositionEvent.initCompositionEvent', | 128 'CompositionEvent.initCompositionEvent', |
| 129 'CustomEvent.initCustomEvent', | 129 'CustomEvent.initCustomEvent', |
| 130 'DeviceOrientationEvent.initDeviceOrientationEvent', | 130 'DeviceOrientationEvent.initDeviceOrientationEvent', |
| 131 'Document.createElement', | 131 'Document.createElement', |
| 132 'Document.createElementNS', | 132 'Document.createElementNS', |
| 133 'Document.createEvent', | 133 'Document.createEvent', |
| 134 'Document.createRange', | 134 'Document.createRange', |
| 135 'Document.createTextNode', | 135 'Document.createTextNode', |
| 136 'Document.createTouch', | 136 'Document.createTouch', |
| 137 'Document.createTouchList', | 137 'Document.createTouchList', |
| 138 'Document.getElementById', | |
| 139 'Document.getElementsByClassName', | |
| 140 'Document.getElementsByName', | |
| 141 'Document.getElementsByTagName', | |
| 142 'Document.querySelector', | |
| 143 'Document.querySelectorAll', | 138 'Document.querySelectorAll', |
| 144 | 139 |
| 145 # Moved to HTMLDocument. | 140 # Moved to HTMLDocument. |
| 146 'Document.body', | 141 'Document.body', |
| 147 'Document.caretRangeFromPoint', | 142 'Document.caretRangeFromPoint', |
| 148 'Document.elementFromPoint', | 143 'Document.elementFromPoint', |
| 149 'Document.getCSSCanvasContext', | 144 'Document.getCSSCanvasContext', |
| 150 'Document.head', | 145 'Document.head', |
| 151 'Document.lastModified', | 146 'Document.lastModified', |
| 152 'Document.preferredStylesheetSet', | 147 'Document.preferredStylesheetSet', |
| (...skipping 16 matching lines...) Expand all Loading... |
| 169 'Element.childElementCount', | 164 'Element.childElementCount', |
| 170 'Element.children', | 165 'Element.children', |
| 171 'Element.className', | 166 'Element.className', |
| 172 'Element.clientHeight', | 167 'Element.clientHeight', |
| 173 'Element.clientLeft', | 168 'Element.clientLeft', |
| 174 'Element.clientTop', | 169 'Element.clientTop', |
| 175 'Element.clientWidth', | 170 'Element.clientWidth', |
| 176 'Element.firstElementChild', | 171 'Element.firstElementChild', |
| 177 'Element.getAttribute', | 172 'Element.getAttribute', |
| 178 'Element.getAttributeNS', | 173 'Element.getAttributeNS', |
| 179 'Element.getElementsByClassName', | |
| 180 'Element.getElementsByTagName', | 174 'Element.getElementsByTagName', |
| 181 'Element.hasAttribute', | 175 'Element.hasAttribute', |
| 182 'Element.hasAttributeNS', | 176 'Element.hasAttributeNS', |
| 183 'Element.lastElementChild', | 177 'Element.lastElementChild', |
| 184 'Element.offsetHeight', | 178 'Element.offsetHeight', |
| 185 'Element.offsetLeft', | 179 'Element.offsetLeft', |
| 186 'Element.offsetTop', | 180 'Element.offsetTop', |
| 187 'Element.offsetWidth', | 181 'Element.offsetWidth', |
| 188 'Element.querySelector', | |
| 189 'Element.querySelectorAll', | 182 'Element.querySelectorAll', |
| 190 'Element.removeAttribute', | 183 'Element.removeAttribute', |
| 191 'Element.removeAttributeNS', | 184 'Element.removeAttributeNS', |
| 192 'Element.scrollIntoView', | 185 'Element.scrollIntoView', |
| 193 'Element.scrollIntoViewIfNeeded', | 186 'Element.scrollIntoViewIfNeeded', |
| 194 'Element.setAttributeNS', | 187 'Element.setAttributeNS', |
| 195 'Element.setAttribute', | 188 'Element.setAttribute', |
| 196 'Element.setAttributeNS', | 189 'Element.setAttributeNS', |
| 197 'ElementTraversal.childElementCount', | 190 'ElementTraversal.childElementCount', |
| 198 'ElementTraversal.firstElementChild', | 191 'ElementTraversal.firstElementChild', |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 'Node.firstChild', | 245 'Node.firstChild', |
| 253 'Node.lastChild', | 246 'Node.lastChild', |
| 254 'Node.localName', | 247 'Node.localName', |
| 255 'Node.namespaceURI', | 248 'Node.namespaceURI', |
| 256 'Node.removeChild', | 249 'Node.removeChild', |
| 257 'Node.replaceChild', | 250 'Node.replaceChild', |
| 258 'Screen.availHeight', | 251 'Screen.availHeight', |
| 259 'Screen.availLeft', | 252 'Screen.availLeft', |
| 260 'Screen.availTop', | 253 'Screen.availTop', |
| 261 'Screen.availWidth', | 254 'Screen.availWidth', |
| 262 'ShadowRoot.getElementById', | |
| 263 'ShadowRoot.getElementsByClassName', | |
| 264 'ShadowRoot.getElementsByTagName', | |
| 265 'Storage.clear', | 255 'Storage.clear', |
| 266 'Storage.getItem', | 256 'Storage.getItem', |
| 267 'Storage.key', | 257 'Storage.key', |
| 268 'Storage.length', | 258 'Storage.length', |
| 269 'Storage.removeItem', | 259 'Storage.removeItem', |
| 270 'Storage.setItem', | 260 'Storage.setItem', |
| 271 'StorageEvent.initStorageEvent', | 261 'StorageEvent.initStorageEvent', |
| 272 'TextEvent.initTextEvent', | 262 'TextEvent.initTextEvent', |
| 273 'Touch.clientX', | 263 'Touch.clientX', |
| 274 'Touch.clientY', | 264 'Touch.clientY', |
| (...skipping 13 matching lines...) Expand all Loading... |
| 288 'WheelEvent.wheelDeltaY', | 278 'WheelEvent.wheelDeltaY', |
| 289 'WheelEvent.initWebKitWheelEvent', | 279 'WheelEvent.initWebKitWheelEvent', |
| 290 'DOMWindow.getComputedStyle', | 280 'DOMWindow.getComputedStyle', |
| 291 ]) | 281 ]) |
| 292 | 282 |
| 293 # Members from the standard dom that exist in the dart:html library with | 283 # Members from the standard dom that exist in the dart:html library with |
| 294 # identical functionality but with cleaner names. | 284 # identical functionality but with cleaner names. |
| 295 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { | 285 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { |
| 296 'Document.createCDATASection': 'createCDataSection', | 286 'Document.createCDATASection': 'createCDataSection', |
| 297 'Document.defaultView': 'window', | 287 'Document.defaultView': 'window', |
| 288 'Document.querySelector': 'query', |
| 298 'DOMURL.createObjectURL': 'createObjectUrl', | 289 'DOMURL.createObjectURL': 'createObjectUrl', |
| 299 'DOMURL.revokeObjectURL': 'revokeObjectUrl', | 290 'DOMURL.revokeObjectURL': 'revokeObjectUrl', |
| 300 'DOMWindow.clearTimeout': '_clearTimeout', | 291 'DOMWindow.clearTimeout': '_clearTimeout', |
| 301 'DOMWindow.clearInterval': '_clearInterval', | 292 'DOMWindow.clearInterval': '_clearInterval', |
| 302 'DOMWindow.setTimeout': '_setTimeout', | 293 'DOMWindow.setTimeout': '_setTimeout', |
| 303 'DOMWindow.setInterval': '_setInterval', | 294 'DOMWindow.setInterval': '_setInterval', |
| 304 'DOMWindow.webkitConvertPointFromNodeToPage': 'convertPointFromNodeToPage', | 295 'DOMWindow.webkitConvertPointFromNodeToPage': 'convertPointFromNodeToPage', |
| 305 'DOMWindow.webkitConvertPointFromPageToNode': 'convertPointFromPageToNode', | 296 'DOMWindow.webkitConvertPointFromPageToNode': 'convertPointFromPageToNode', |
| 306 'DOMWindow.webkitNotifications': 'notifications', | 297 'DOMWindow.webkitNotifications': 'notifications', |
| 307 'DOMWindow.webkitRequestFileSystem': 'requestFileSystem', | 298 'DOMWindow.webkitRequestFileSystem': 'requestFileSystem', |
| 308 'DOMWindow.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', | 299 'DOMWindow.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', |
| 300 'Element.querySelector': 'query', |
| 309 'Element.webkitCreateShadowRoot': 'createShadowRoot', | 301 'Element.webkitCreateShadowRoot': 'createShadowRoot', |
| 310 'Element.webkitMatchesSelector' : 'matches', | 302 'Element.webkitMatchesSelector' : 'matches', |
| 311 'Navigator.webkitGetUserMedia': '_getUserMedia', | 303 'Navigator.webkitGetUserMedia': '_getUserMedia', |
| 312 'Node.appendChild': 'append', | 304 'Node.appendChild': 'append', |
| 313 'Node.cloneNode': 'clone', | 305 'Node.cloneNode': 'clone', |
| 314 'Node.nextSibling': 'nextNode', | 306 'Node.nextSibling': 'nextNode', |
| 315 'Node.ownerDocument': 'document', | 307 'Node.ownerDocument': 'document', |
| 316 'Node.parentElement': 'parent', | 308 'Node.parentElement': 'parent', |
| 317 'Node.previousSibling': 'previousNode', | 309 'Node.previousSibling': 'previousNode', |
| 318 'Node.textContent': 'text', | 310 'Node.textContent': 'text', |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 | 702 |
| 711 # We're looking for a sequence of letters which start with capital letter | 703 # We're looking for a sequence of letters which start with capital letter |
| 712 # then a series of caps and finishes with either the end of the string or | 704 # then a series of caps and finishes with either the end of the string or |
| 713 # a capital letter. | 705 # a capital letter. |
| 714 # The [0-9] check is for names such as 2D or 3D | 706 # The [0-9] check is for names such as 2D or 3D |
| 715 # The following test cases should match as: | 707 # The following test cases should match as: |
| 716 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 708 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 717 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 709 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 718 # IFrameElement: (I)()(F)rameElement (no change) | 710 # IFrameElement: (I)()(F)rameElement (no change) |
| 719 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 711 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |