| 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 typed_array_renames = { | 9 typed_array_renames = { |
| 10 'ArrayBuffer': 'ByteBuffer', | 10 'ArrayBuffer': 'ByteBuffer', |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 html_interface_renames[interface] = '_' + interface | 127 html_interface_renames[interface] = '_' + interface |
| 128 | 128 |
| 129 convert_to_future_members = monitored.Set( | 129 convert_to_future_members = monitored.Set( |
| 130 'htmlrenamer.converted_to_future_members', [ | 130 'htmlrenamer.converted_to_future_members', [ |
| 131 'AudioContext.decodeAudioData', | 131 'AudioContext.decodeAudioData', |
| 132 'DataTransferItem.getAsString', | 132 'DataTransferItem.getAsString', |
| 133 'DirectoryEntry.getDirectory', | 133 'DirectoryEntry.getDirectory', |
| 134 'DirectoryEntry.getFile', | 134 'DirectoryEntry.getFile', |
| 135 'DirectoryEntry.removeRecursively', | 135 'DirectoryEntry.removeRecursively', |
| 136 'DirectoryReader.readEntries', | 136 'DirectoryReader.readEntries', |
| 137 'Window.webkitRequestFileSystem', | |
| 138 'Window.webkitResolveLocalFileSystemURL', | |
| 139 'Entry.copyTo', | 137 'Entry.copyTo', |
| 140 'Entry.getMetadata', | 138 'Entry.getMetadata', |
| 141 'Entry.getParent', | 139 'Entry.getParent', |
| 142 'Entry.moveTo', | 140 'Entry.moveTo', |
| 143 'Entry.remove', | 141 'Entry.remove', |
| 144 'FileEntry.createWriter', | 142 'FileEntry.createWriter', |
| 145 'FileEntry.file', | 143 'FileEntry.file', |
| 144 'FontLoader.notifyWhenFontsReady', |
| 145 'MediaStreamTrack.getSources', |
| 146 'Notification.requestPermission', | 146 'Notification.requestPermission', |
| 147 'NotificationCenter.requestPermission', | 147 'NotificationCenter.requestPermission', |
| 148 'RTCPeerConnection.setLocalDescription', | 148 'RTCPeerConnection.setLocalDescription', |
| 149 'RTCPeerConnection.setRemoteDescription', | 149 'RTCPeerConnection.setRemoteDescription', |
| 150 'StorageInfo.requestQuota', | 150 'StorageInfo.requestQuota', |
| 151 'StorageQuota.requestQuota', |
| 152 'Window.webkitRequestFileSystem', |
| 153 'Window.webkitResolveLocalFileSystemURL', |
| 154 'WorkerGlobalScope.webkitRequestFileSystem', |
| 151 'WorkerGlobalScope.webkitResolveLocalFileSystemURL', | 155 'WorkerGlobalScope.webkitResolveLocalFileSystemURL', |
| 152 'WorkerGlobalScope.webkitRequestFileSystem', | |
| 153 ]) | 156 ]) |
| 154 | 157 |
| 155 # "Private" members in the form $dom_foo. | 158 # "Private" members in the form $dom_foo. |
| 156 # TODO(efortuna): Remove this set. This allows us to make the change of removing | 159 # TODO(efortuna): Remove this set. This allows us to make the change of removing |
| 157 # $dom in installments instead of all at once, but the intent is to move all of | 160 # $dom in installments instead of all at once, but the intent is to move all of |
| 158 # these either into private_html_members or remove them from this list entirely. | 161 # these either into private_html_members or remove them from this list entirely. |
| 159 dom_private_html_members = monitored.Set('htmlrenamer.private_html_members', [ | 162 dom_private_html_members = monitored.Set('htmlrenamer.private_html_members', [ |
| 160 'EventTarget.addEventListener', | 163 'EventTarget.addEventListener', |
| 161 'EventTarget.removeEventListener', | 164 'EventTarget.removeEventListener', |
| 162 ]) | 165 ]) |
| 163 | 166 |
| 164 # Classes where we have customized constructors, but we need to keep the old | 167 # Classes where we have customized constructors, but we need to keep the old |
| 165 # constructor for dispatch purposes. | 168 # constructor for dispatch purposes. |
| 166 custom_html_constructors = monitored.Set( | 169 custom_html_constructors = monitored.Set( |
| 167 'htmlrenamer.custom_html_constructors', [ | 170 'htmlrenamer.custom_html_constructors', [ |
| 168 'HTMLOptionElement', | 171 'HTMLOptionElement', |
| 172 'MutationObserver', |
| 169 ]) | 173 ]) |
| 170 | 174 |
| 171 # Members from the standard dom that should not be exposed publicly in dart:html | 175 # Members from the standard dom that should not be exposed publicly in dart:html |
| 172 # but need to be exposed internally to implement dart:html on top of a standard | 176 # but need to be exposed internally to implement dart:html on top of a standard |
| 173 # browser. They are exposed simply by placing an underscore in front of the | 177 # browser. They are exposed simply by placing an underscore in front of the |
| 174 # name. | 178 # name. |
| 175 private_html_members = monitored.Set('htmlrenamer.private_html_members', [ | 179 private_html_members = monitored.Set('htmlrenamer.private_html_members', [ |
| 176 'AudioNode.connect', | 180 'AudioNode.connect', |
| 177 'CanvasRenderingContext2D.arc', | 181 'CanvasRenderingContext2D.arc', |
| 178 'CanvasRenderingContext2D.drawImage', | 182 'CanvasRenderingContext2D.drawImage', |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 'Node.localName', | 287 'Node.localName', |
| 284 'Node.namespaceURI', | 288 'Node.namespaceURI', |
| 285 'Node.removeChild', | 289 'Node.removeChild', |
| 286 'Node.replaceChild', | 290 'Node.replaceChild', |
| 287 'ParentNode.childElementCount', | 291 'ParentNode.childElementCount', |
| 288 'ParentNode.children', | 292 'ParentNode.children', |
| 289 'ParentNode.firstElementChild', | 293 'ParentNode.firstElementChild', |
| 290 'ParentNode.lastElementChild', | 294 'ParentNode.lastElementChild', |
| 291 'RTCPeerConnection.createAnswer', | 295 'RTCPeerConnection.createAnswer', |
| 292 'RTCPeerConnection.createOffer', | 296 'RTCPeerConnection.createOffer', |
| 297 'RTCPeerConnection.getStats', |
| 293 'Screen.availHeight', | 298 'Screen.availHeight', |
| 294 'Screen.availLeft', | 299 'Screen.availLeft', |
| 295 'Screen.availTop', | 300 'Screen.availTop', |
| 296 'Screen.availWidth', | 301 'Screen.availWidth', |
| 297 'Storage.clear', | 302 'Storage.clear', |
| 298 'Storage.getItem', | 303 'Storage.getItem', |
| 299 'Storage.key', | 304 'Storage.key', |
| 300 'Storage.length', | 305 'Storage.length', |
| 301 'Storage.removeItem', | 306 'Storage.removeItem', |
| 302 'Storage.setItem', | 307 'Storage.setItem', |
| (...skipping 13 matching lines...) Expand all Loading... |
| 316 'UIEvent.layerX', | 321 'UIEvent.layerX', |
| 317 'UIEvent.layerY', | 322 'UIEvent.layerY', |
| 318 'UIEvent.pageX', | 323 'UIEvent.pageX', |
| 319 'UIEvent.pageY', | 324 'UIEvent.pageY', |
| 320 'WebGLRenderingContext.texImage2D', | 325 'WebGLRenderingContext.texImage2D', |
| 321 'WheelEvent.initWebKitWheelEvent', | 326 'WheelEvent.initWebKitWheelEvent', |
| 322 'WheelEvent.deltaX', | 327 'WheelEvent.deltaX', |
| 323 'WheelEvent.deltaY', | 328 'WheelEvent.deltaY', |
| 324 'Window.createImageBitmap', | 329 'Window.createImageBitmap', |
| 325 'Window.getComputedStyle', | 330 'Window.getComputedStyle', |
| 331 'Window.clearInterval', |
| 332 'Window.clearTimeout', |
| 326 'Window.moveTo', | 333 'Window.moveTo', |
| 327 'Window.clearTimeout', | 334 'Window.requestAnimationFrame', |
| 328 'Window.clearInterval', | 335 'Window.setInterval', |
| 329 'Window.setTimeout', | 336 'Window.setTimeout', |
| 330 'Window.setInterval', | |
| 331 ]) | 337 ]) |
| 332 | 338 |
| 333 # Members from the standard dom that exist in the dart:html library with | 339 # Members from the standard dom that exist in the dart:html library with |
| 334 # identical functionality but with cleaner names. | 340 # identical functionality but with cleaner names. |
| 335 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { | 341 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { |
| 336 'CSSKeyframesRule.insertRule': 'appendRule', | 342 'CSSKeyframesRule.insertRule': 'appendRule', |
| 337 'DirectoryEntry.getDirectory': '_getDirectory', | 343 'DirectoryEntry.getDirectory': '_getDirectory', |
| 338 'DirectoryEntry.getFile': '_getFile', | 344 'DirectoryEntry.getFile': '_getFile', |
| 339 'Document.createCDATASection': 'createCDataSection', | 345 'Document.createCDATASection': 'createCDataSection', |
| 340 'Document.defaultView': 'window', | 346 'Document.defaultView': 'window', |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 | 945 |
| 940 # We're looking for a sequence of letters which start with capital letter | 946 # We're looking for a sequence of letters which start with capital letter |
| 941 # then a series of caps and finishes with either the end of the string or | 947 # then a series of caps and finishes with either the end of the string or |
| 942 # a capital letter. | 948 # a capital letter. |
| 943 # The [0-9] check is for names such as 2D or 3D | 949 # The [0-9] check is for names such as 2D or 3D |
| 944 # The following test cases should match as: | 950 # The following test cases should match as: |
| 945 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 951 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 946 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 952 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 947 # IFrameElement: (I)()(F)rameElement (no change) | 953 # IFrameElement: (I)()(F)rameElement (no change) |
| 948 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 954 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |