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

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

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