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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 'WindowTimers.setTimeout', | 425 'WindowTimers.setTimeout', |
426 'Window.moveTo', | 426 'Window.moveTo', |
427 'Window.requestAnimationFrame', | 427 'Window.requestAnimationFrame', |
428 'Window.setInterval', | 428 'Window.setInterval', |
429 'Window.setTimeout', | 429 'Window.setTimeout', |
430 ]) | 430 ]) |
431 | 431 |
432 # Members from the standard dom that exist in the dart:html library with | 432 # Members from the standard dom that exist in the dart:html library with |
433 # identical functionality but with cleaner names. | 433 # identical functionality but with cleaner names. |
434 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { | 434 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { |
435 'ConsoleBase.assert': 'assertCondition', | 435 'ConsoleBase.assert': 'assertCondition', 'CSSKeyframesRule.insertRule': |
436 'CSSKeyframesRule.insertRule': 'appendRule', | 436 'appendRule', 'DirectoryEntry.getDirectory': '_getDirectory', |
437 'DirectoryEntry.getDirectory': '_getDirectory', | 437 'DirectoryEntry.getFile': '_getFile', 'Document.createCDATASection': |
438 'DirectoryEntry.getFile': '_getFile', | 438 'createCDataSection', 'Document.defaultView': 'window', 'Window.CSS': 'css', |
439 'Document.createCDATASection': 'createCDataSection', | |
440 'Document.defaultView': 'window', | |
441 'Window.CSS': 'css', | |
442 'Window.webkitNotifications': 'notifications', | 439 'Window.webkitNotifications': 'notifications', |
443 'Window.webkitRequestFileSystem': '_requestFileSystem', | 440 'Window.webkitRequestFileSystem': '_requestFileSystem', |
444 'Window.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', | 441 'Window.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', |
445 'Navigator.webkitGetUserMedia': '_getUserMedia', | 442 'Navigator.webkitGetUserMedia': '_getUserMedia', 'Node.appendChild': |
446 'Node.appendChild': 'append', | 443 'append', 'Node.cloneNode': 'clone', 'Node.nextSibling': 'nextNode', |
447 'Node.cloneNode': 'clone', | 444 'Node.parentElement': 'parent', 'Node.previousSibling': 'previousNode', |
448 'Node.nextSibling': 'nextNode', | 445 'Node.textContent': 'text', 'SVGElement.className': '_svgClassName', |
449 'Node.parentElement': 'parent', | 446 'SVGStopElement.offset': 'gradientOffset', 'URL.createObjectURL': |
450 'Node.previousSibling': 'previousNode', | 447 'createObjectUrl', 'URL.revokeObjectURL': 'revokeObjectUrl', |
451 'Node.textContent': 'text', | |
452 'SVGElement.className': '_svgClassName', | |
453 'SVGStopElement.offset': 'gradientOffset', | |
454 'URL.createObjectURL': 'createObjectUrl', | |
455 'URL.revokeObjectURL': 'revokeObjectUrl', | |
456 #'WorkerContext.webkitRequestFileSystem': '_requestFileSystem', | 448 #'WorkerContext.webkitRequestFileSystem': '_requestFileSystem', |
457 #'WorkerContext.webkitRequestFileSystemSync': '_requestFileSystemSync', | 449 #'WorkerContext.webkitRequestFileSystemSync': '_requestFileSystemSync', |
| 450 |
| 451 # OfflineAudioContext.suspend has an signature incompatible with shadowed |
| 452 # base class method AudioContext.suspend. |
| 453 'OfflineAudioContext.suspend': 'suspendFor', |
458 }) | 454 }) |
459 | 455 |
460 # Members that have multiple definitions, but their types are vary, so we rename | 456 # Members that have multiple definitions, but their types are vary, so we rename |
461 # them to make them distinct. | 457 # them to make them distinct. |
462 renamed_overloads = monitored.Dict('htmldartgenerator.renamed_overloads', { | 458 renamed_overloads = monitored.Dict('htmldartgenerator.renamed_overloads', { |
463 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)': | 459 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)': |
464 'createBufferFromBuffer', | 460 'createBufferFromBuffer', |
465 'CSS.supports(DOMString conditionText)': 'supportsCondition', | 461 'CSS.supports(DOMString conditionText)': 'supportsCondition', |
466 'DataTransferItemList.add(File file)': 'addFile', | 462 'DataTransferItemList.add(File file)': 'addFile', |
467 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData', | 463 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData', |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 | 1102 |
1107 # We're looking for a sequence of letters which start with capital letter | 1103 # We're looking for a sequence of letters which start with capital letter |
1108 # then a series of caps and finishes with either the end of the string or | 1104 # then a series of caps and finishes with either the end of the string or |
1109 # a capital letter. | 1105 # a capital letter. |
1110 # The [0-9] check is for names such as 2D or 3D | 1106 # The [0-9] check is for names such as 2D or 3D |
1111 # The following test cases should match as: | 1107 # The following test cases should match as: |
1112 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 1108 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
1113 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 1109 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
1114 # IFrameElement: (I)()(F)rameElement (no change) | 1110 # IFrameElement: (I)()(F)rameElement (no change) |
1115 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 1111 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
OLD | NEW |