Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: tools/dom/scripts/htmlrenamer.py

Issue 605083004: Merge 38 changes to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/idlnode.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 12 matching lines...) Expand all
23 23
24 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', 24 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames',
25 dict({ 25 dict({
26 'Attr': '_Attr', 26 'Attr': '_Attr',
27 'CDATASection': 'CDataSection', 27 'CDATASection': 'CDataSection',
28 'Clipboard': 'DataTransfer', 28 'Clipboard': 'DataTransfer',
29 'Database': 'SqlDatabase', # Avoid conflict with Index DB's Database. 29 'Database': 'SqlDatabase', # Avoid conflict with Index DB's Database.
30 'DatabaseSync': 'SqlDatabaseSync', 30 'DatabaseSync': 'SqlDatabaseSync',
31 'DOMFileSystem': 'FileSystem', 31 'DOMFileSystem': 'FileSystem',
32 'WebKitPoint': '_DomPoint', 32 'WebKitPoint': '_DomPoint',
33 'DOMRect': '_DomRect',
33 'Entity': '_Entity', # Not sure if we want to expose this yet, may conflict with other libs. 34 'Entity': '_Entity', # Not sure if we want to expose this yet, may conflict with other libs.
34 'EntryCallback': '_EntryCallback', 35 'EntryCallback': '_EntryCallback',
35 'EntriesCallback': '_EntriesCallback', 36 'EntriesCallback': '_EntriesCallback',
36 'ErrorCallback': '_ErrorCallback', 37 'ErrorCallback': '_ErrorCallback',
37 'FileCallback': '_FileCallback', 38 'FileCallback': '_FileCallback',
38 'FileSystemCallback': '_FileSystemCallback', 39 'FileSystemCallback': '_FileSystemCallback',
39 'FileWriterCallback': '_FileWriterCallback', 40 'FileWriterCallback': '_FileWriterCallback',
40 'HTMLDocument' : 'HtmlDocument', 41 'HTMLDocument' : 'HtmlDocument',
41 'HTMLElement' : 'HtmlElement', 42 'HTMLElement' : 'HtmlElement',
42 'HTMLHtmlElement' : 'HtmlHtmlElement', 43 'HTMLHtmlElement' : 'HtmlHtmlElement',
(...skipping 18 matching lines...) Expand all
61 'WebGLVertexArrayObjectOES': 'VertexArrayObject', 62 'WebGLVertexArrayObjectOES': 'VertexArrayObject',
62 'WindowTimers': '_WindowTimers', 63 'WindowTimers': '_WindowTimers',
63 'XMLHttpRequest': 'HttpRequest', 64 'XMLHttpRequest': 'HttpRequest',
64 'XMLHttpRequestUpload': 'HttpRequestUpload', 65 'XMLHttpRequestUpload': 'HttpRequestUpload',
65 'XMLHttpRequestEventTarget': 'HttpRequestEventTarget', 66 'XMLHttpRequestEventTarget': 'HttpRequestEventTarget',
66 }, **typed_array_renames)) 67 }, **typed_array_renames))
67 68
68 # Interfaces that are suppressed, but need to still exist for Dartium and to 69 # Interfaces that are suppressed, but need to still exist for Dartium and to
69 # properly wrap DOM objects if/when encountered. 70 # properly wrap DOM objects if/when encountered.
70 _removed_html_interfaces = [ 71 _removed_html_interfaces = [
72 'Cache', # TODO: Symbol conflicts with Angular: dartbug.com/20937
71 'CanvasPathMethods', 73 'CanvasPathMethods',
72 'CDataSection', 74 'CDataSection',
73 'CSSPrimitiveValue', 75 'CSSPrimitiveValue',
74 'CSSUnknownRule', 76 'CSSUnknownRule',
75 'CSSValue', 77 'CSSValue',
76 'Counter', 78 'Counter',
77 'DOMFileSystemSync', # Workers 79 'DOMFileSystemSync', # Workers
78 'DatabaseSync', # Workers 80 'DatabaseSync', # Workers
79 'DataView', # Typed arrays 81 'DataView', # Typed arrays
80 'DirectoryEntrySync', # Workers 82 'DirectoryEntrySync', # Workers
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 'Document.getCSSCanvasContext', 214 'Document.getCSSCanvasContext',
213 'Document.head', 215 'Document.head',
214 'Document.lastModified', 216 'Document.lastModified',
215 'Document.preferredStylesheetSet', 217 'Document.preferredStylesheetSet',
216 'Document.referrer', 218 'Document.referrer',
217 'Document.selectedStylesheetSet', 219 'Document.selectedStylesheetSet',
218 'Document.styleSheets', 220 'Document.styleSheets',
219 'Document.title', 221 'Document.title',
220 'Document.webkitCancelFullScreen', 222 'Document.webkitCancelFullScreen',
221 'Document.webkitExitFullscreen', 223 'Document.webkitExitFullscreen',
222 'Document.webkitExitPointerLock',
223 'Document.webkitFullscreenElement', 224 'Document.webkitFullscreenElement',
224 'Document.webkitFullscreenEnabled', 225 'Document.webkitFullscreenEnabled',
225 'Document.webkitHidden', 226 'Document.webkitHidden',
226 'Document.webkitIsFullScreen', 227 'Document.webkitIsFullScreen',
227 'Document.webkitPointerLockElement', 228 'Document.webkitPointerLockElement',
228 'Document.webkitVisibilityState', 229 'Document.webkitVisibilityState',
229 230
230 'Element.children', 231 'Element.children',
231 'Element.childElementCount', 232 'Element.childElementCount',
232 'Element.firstElementChild', 233 'Element.firstElementChild',
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 'ShadowRoot.resetStyleInheritance', 330 'ShadowRoot.resetStyleInheritance',
330 'Storage.clear', 331 'Storage.clear',
331 'Storage.getItem', 332 'Storage.getItem',
332 'Storage.key', 333 'Storage.key',
333 'Storage.length', 334 'Storage.length',
334 'Storage.removeItem', 335 'Storage.removeItem',
335 'Storage.setItem', 336 'Storage.setItem',
336 'StorageEvent.initStorageEvent', 337 'StorageEvent.initStorageEvent',
337 'TextEvent.initTextEvent', 338 'TextEvent.initTextEvent',
338 # TODO(leafp): These have been converted from int to double in Chrome 37. 339 # TODO(leafp): These have been converted from int to double in Chrome 37.
339 # client, page, and screen were already special cased, adding webKitRadius. 340 # client, page, and screen were already special cased, adding radiusX/radiusY.
340 # See impl_Touch.darttemplate for impedance matching code 341 # See impl_Touch.darttemplate for impedance matching code
341 'Touch.clientX', 342 'Touch.clientX',
342 'Touch.clientY', 343 'Touch.clientY',
343 'Touch.pageX', 344 'Touch.pageX',
344 'Touch.pageY', 345 'Touch.pageY',
345 'Touch.screenX', 346 'Touch.screenX',
346 'Touch.screenY', 347 'Touch.screenY',
347 'Touch.webkitRadiusX', 348 'Touch.radiusX',
348 'Touch.webkitRadiusY', 349 'Touch.radiusY',
349 'TouchEvent.initTouchEvent', 350 'TouchEvent.initTouchEvent',
350 'UIEvent.charCode', 351 'UIEvent.charCode',
351 'UIEvent.initUIEvent', 352 'UIEvent.initUIEvent',
352 'UIEvent.keyCode', 353 'UIEvent.keyCode',
353 'UIEvent.layerX', 354 'UIEvent.layerX',
354 'UIEvent.layerY', 355 'UIEvent.layerY',
355 'UIEvent.pageX', 356 'UIEvent.pageX',
356 'UIEvent.pageY', 357 'UIEvent.pageY',
357 'WheelEvent.initWebKitWheelEvent', 358 'WheelEvent.initWebKitWheelEvent',
358 'WheelEvent.deltaX', 359 'WheelEvent.deltaX',
(...skipping 14 matching lines...) Expand all
373 374
374 # Members from the standard dom that exist in the dart:html library with 375 # Members from the standard dom that exist in the dart:html library with
375 # identical functionality but with cleaner names. 376 # identical functionality but with cleaner names.
376 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { 377 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', {
377 'CSSKeyframesRule.insertRule': 'appendRule', 378 'CSSKeyframesRule.insertRule': 'appendRule',
378 'DirectoryEntry.getDirectory': '_getDirectory', 379 'DirectoryEntry.getDirectory': '_getDirectory',
379 'DirectoryEntry.getFile': '_getFile', 380 'DirectoryEntry.getFile': '_getFile',
380 'Document.createCDATASection': 'createCDataSection', 381 'Document.createCDATASection': 'createCDataSection',
381 'Document.defaultView': 'window', 382 'Document.defaultView': 'window',
382 'Window.CSS': 'css', 383 'Window.CSS': 'css',
383 'Window.webkitConvertPointFromNodeToPage': '_convertPointFromNodeToPage',
384 'Window.webkitConvertPointFromPageToNode': '_convertPointFromPageToNode',
385 'Window.webkitNotifications': 'notifications', 384 'Window.webkitNotifications': 'notifications',
386 'Window.webkitRequestFileSystem': '_requestFileSystem', 385 'Window.webkitRequestFileSystem': '_requestFileSystem',
387 'Window.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl', 386 'Window.webkitResolveLocalFileSystemURL': 'resolveLocalFileSystemUrl',
388 'Navigator.webkitGetUserMedia': '_getUserMedia', 387 'Navigator.webkitGetUserMedia': '_getUserMedia',
389 'Node.appendChild': 'append', 388 'Node.appendChild': 'append',
390 'Node.cloneNode': 'clone', 389 'Node.cloneNode': 'clone',
391 'Node.nextSibling': 'nextNode', 390 'Node.nextSibling': 'nextNode',
392 'Node.parentElement': 'parent', 391 'Node.parentElement': 'parent',
393 'Node.previousSibling': 'previousNode', 392 'Node.previousSibling': 'previousNode',
394 'Node.textContent': 'text', 393 'Node.textContent': 'text',
(...skipping 10 matching lines...) Expand all
405 renamed_overloads = monitored.Dict('htmldartgenerator.renamed_overloads', { 404 renamed_overloads = monitored.Dict('htmldartgenerator.renamed_overloads', {
406 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)': 405 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)':
407 'createBufferFromBuffer', 406 'createBufferFromBuffer',
408 'CSS.supports(DOMString conditionText)': 'supportsCondition', 407 'CSS.supports(DOMString conditionText)': 'supportsCondition',
409 'CanvasRenderingContext2D.createPattern(HTMLImageElement image, ' 408 'CanvasRenderingContext2D.createPattern(HTMLImageElement image, '
410 'DOMString repetitionType)': 'createPatternFromImage', 409 'DOMString repetitionType)': 'createPatternFromImage',
411 'DataTransferItemList.add(File file)': 'addFile', 410 'DataTransferItemList.add(File file)': 'addFile',
412 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData', 411 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData',
413 'FormData.append(DOMString name, Blob value, DOMString filename)': 412 'FormData.append(DOMString name, Blob value, DOMString filename)':
414 'appendBlob', 413 'appendBlob',
415 'IDBDatabase.transaction(DOMStringList storeNames, DOMString mode)': 414 'IDBDatabase.transaction(DOMStringList storeNames, IDBTransactionMode mode)':
416 'transactionStores', 415 'transactionStores',
417 'IDBDatabase.transaction(sequence<DOMString> storeNames, DOMString mode)': 416 'IDBDatabase.transaction(sequence<DOMString> storeNames, IDBTransactionMode mo de)':
418 'transactionList', 417 'transactionList',
419 'IDBDatabase.transaction(DOMString storeName, DOMString mode)': 418 'IDBDatabase.transaction(DOMString storeName, IDBTransactionMode mode)':
420 'transactionStore', 419 'transactionStore',
421 'RTCDataChannel.send(ArrayBuffer data)': 'sendByteBuffer', 420 'RTCDataChannel.send(ArrayBuffer data)': 'sendByteBuffer',
422 'RTCDataChannel.send(ArrayBufferView data)': 'sendTypedData', 421 'RTCDataChannel.send(ArrayBufferView data)': 'sendTypedData',
423 'RTCDataChannel.send(Blob data)': 'sendBlob', 422 'RTCDataChannel.send(Blob data)': 'sendBlob',
424 'RTCDataChannel.send(DOMString data)': 'sendString', 423 'RTCDataChannel.send(DOMString data)': 'sendString',
425 'SourceBuffer.appendBuffer(ArrayBufferView data)': 'appendTypedData', 424 'SourceBuffer.appendBuffer(ArrayBufferView data)': 'appendTypedData',
426 'URL.createObjectURL(MediaSource source)': 425 'URL.createObjectURL(MediaSource source)':
427 'createObjectUrlFromSource', 426 'createObjectUrlFromSource',
428 'URL.createObjectURL(WebKitMediaSource source)': 427 'URL.createObjectURL(WebKitMediaSource source)':
429 '_createObjectUrlFromWebKitSource', 428 '_createObjectUrlFromWebKitSource',
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 'Performance.webkitClearMarks', 780 'Performance.webkitClearMarks',
782 'Performance.webkitClearMeasures', 781 'Performance.webkitClearMeasures',
783 'Performance.webkitGetEntries', 782 'Performance.webkitGetEntries',
784 'Performance.webkitGetEntriesByName', 783 'Performance.webkitGetEntriesByName',
785 'Performance.webkitGetEntriesByType', 784 'Performance.webkitGetEntriesByType',
786 'Performance.webkitMark', 785 'Performance.webkitMark',
787 'Performance.webkitMeasure', 786 'Performance.webkitMeasure',
788 'ShadowRoot.getElementsByTagNameNS', 787 'ShadowRoot.getElementsByTagNameNS',
789 'SVGElement.getPresentationAttribute', 788 'SVGElement.getPresentationAttribute',
790 'SVGElementInstance.on:wheel', 789 'SVGElementInstance.on:wheel',
790 'Touch.get:webkitRadiusX',
791 'Touch.get:webkitRadiusY',
792 'Touch.get:webkitForce',
791 'WheelEvent.wheelDelta', 793 'WheelEvent.wheelDelta',
792 'Window.on:wheel', 794 'Window.on:wheel',
793 'WindowEventHandlers.on:beforeUnload', 795 'WindowEventHandlers.on:beforeUnload',
794 'WorkerGlobalScope.webkitIndexedDB', 796 'WorkerGlobalScope.webkitIndexedDB',
795 # TODO(jacobr): should these be removed? 797 # TODO(jacobr): should these be removed?
796 'Document.close', 798 'Document.close',
797 'Document.hasFocus', 799 'Document.hasFocus',
798 ]) 800 ])
799 801
800 # Manual dart: library name lookup. 802 # Manual dart: library name lookup.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 1003
1002 # We're looking for a sequence of letters which start with capital letter 1004 # We're looking for a sequence of letters which start with capital letter
1003 # then a series of caps and finishes with either the end of the string or 1005 # then a series of caps and finishes with either the end of the string or
1004 # a capital letter. 1006 # a capital letter.
1005 # The [0-9] check is for names such as 2D or 3D 1007 # The [0-9] check is for names such as 2D or 3D
1006 # The following test cases should match as: 1008 # The following test cases should match as:
1007 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 1009 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
1008 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 1010 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
1009 # IFrameElement: (I)()(F)rameElement (no change) 1011 # IFrameElement: (I)()(F)rameElement (no change)
1010 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 1012 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/idlnode.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698