| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 'StorageInfo.requestQuota', | 150 'StorageInfo.requestQuota', |
| 151 'WorkerGlobalScope.webkitResolveLocalFileSystemURL', | 151 'WorkerGlobalScope.webkitResolveLocalFileSystemURL', |
| 152 'WorkerGlobalScope.webkitRequestFileSystem', | 152 'WorkerGlobalScope.webkitRequestFileSystem', |
| 153 ]) | 153 ]) |
| 154 | 154 |
| 155 # "Private" members in the form $dom_foo. | 155 # "Private" members in the form $dom_foo. |
| 156 # TODO(efortuna): Remove this set. This allows us to make the change of removing | 156 # 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 | 157 # $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. | 158 # these either into private_html_members or remove them from this list entirely. |
| 159 dom_private_html_members = monitored.Set('htmlrenamer.private_html_members', [ | 159 dom_private_html_members = monitored.Set('htmlrenamer.private_html_members', [ |
| 160 'Document.createElement', | |
| 161 'Document.createElementNS', | |
| 162 'EventTarget.addEventListener', | 160 'EventTarget.addEventListener', |
| 163 'EventTarget.removeEventListener', | 161 'EventTarget.removeEventListener', |
| 164 ]) | 162 ]) |
| 165 | 163 |
| 166 # Members from the standard dom that should not be exposed publicly in dart:html | 164 # Members from the standard dom that should not be exposed publicly in dart:html |
| 167 # but need to be exposed internally to implement dart:html on top of a standard | 165 # but need to be exposed internally to implement dart:html on top of a standard |
| 168 # browser. They are exposed simply by placing an underscore in front of the | 166 # browser. They are exposed simply by placing an underscore in front of the |
| 169 # name. | 167 # name. |
| 170 private_html_members = monitored.Set('htmlrenamer.private_html_members', [ | 168 private_html_members = monitored.Set('htmlrenamer.private_html_members', [ |
| 171 'AudioNode.connect', | 169 'AudioNode.connect', |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 # Members that have multiple definitions, but their types are vary, so we rename | 359 # Members that have multiple definitions, but their types are vary, so we rename |
| 362 # them to make them distinct. | 360 # them to make them distinct. |
| 363 renamed_overloads = monitored.Dict('htmldartgenreator.renamed_overloads', { | 361 renamed_overloads = monitored.Dict('htmldartgenreator.renamed_overloads', { |
| 364 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)': | 362 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)': |
| 365 'createBufferFromBuffer', | 363 'createBufferFromBuffer', |
| 366 'CSS.supports(DOMString conditionText)': 'supportsCondition', | 364 'CSS.supports(DOMString conditionText)': 'supportsCondition', |
| 367 'CanvasRenderingContext2D.createPattern(HTMLImageElement image, ' | 365 'CanvasRenderingContext2D.createPattern(HTMLImageElement image, ' |
| 368 'DOMString repetitionType)': 'createPatternFromImage', | 366 'DOMString repetitionType)': 'createPatternFromImage', |
| 369 'DataTransferItemList.add(File file)': 'addFile', | 367 'DataTransferItemList.add(File file)': 'addFile', |
| 370 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData', | 368 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData', |
| 369 'Document.createElement(DOMString tagName)': None, |
| 370 'Document.createElementNS(DOMString namespaceURI, DOMString qualifiedName)': N
one, |
| 371 'FormData.append(DOMString name, Blob value, DOMString filename)': | 371 'FormData.append(DOMString name, Blob value, DOMString filename)': |
| 372 'appendBlob', | 372 'appendBlob', |
| 373 'IDBDatabase.transaction(DOMStringList storeNames, DOMString mode)': | 373 'IDBDatabase.transaction(DOMStringList storeNames, DOMString mode)': |
| 374 'transactionStores', | 374 'transactionStores', |
| 375 'IDBDatabase.transaction(sequence<DOMString> storeNames, DOMString mode)': | 375 'IDBDatabase.transaction(sequence<DOMString> storeNames, DOMString mode)': |
| 376 'transactionList', | 376 'transactionList', |
| 377 'IDBDatabase.transaction(DOMString storeName, DOMString mode)': | 377 'IDBDatabase.transaction(DOMString storeName, DOMString mode)': |
| 378 'transactionStore', | 378 'transactionStore', |
| 379 'ImageBitmapFactories.createImageBitmap(HTMLImageElement image)' : 'createImag
eBitmap0', | 379 'ImageBitmapFactories.createImageBitmap(HTMLImageElement image)' : 'createImag
eBitmap0', |
| 380 'ImageBitmapFactories.createImageBitmap(HTMLImageElement image, long sx, long
sy, long sw, long sh)' : 'createImageBitmap1', | 380 'ImageBitmapFactories.createImageBitmap(HTMLImageElement image, long sx, long
sy, long sw, long sh)' : 'createImageBitmap1', |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 | 894 |
| 895 # We're looking for a sequence of letters which start with capital letter | 895 # We're looking for a sequence of letters which start with capital letter |
| 896 # then a series of caps and finishes with either the end of the string or | 896 # then a series of caps and finishes with either the end of the string or |
| 897 # a capital letter. | 897 # a capital letter. |
| 898 # The [0-9] check is for names such as 2D or 3D | 898 # The [0-9] check is for names such as 2D or 3D |
| 899 # The following test cases should match as: | 899 # The following test cases should match as: |
| 900 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 900 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 901 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 901 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 902 # IFrameElement: (I)()(F)rameElement (no change) | 902 # IFrameElement: (I)()(F)rameElement (no change) |
| 903 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 903 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |