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

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

Issue 19789017: Regenerate dart:html from new Blink IDL files (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More fixes Created 7 years, 4 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') | no next file » | 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 'NavigatorUserMediaSuccessCallback': '_NavigatorUserMediaSuccessCallback', 45 'NavigatorUserMediaSuccessCallback': '_NavigatorUserMediaSuccessCallback',
46 'NotificationPermissionCallback': '_NotificationPermissionCallback', 46 'NotificationPermissionCallback': '_NotificationPermissionCallback',
47 'PositionCallback': '_PositionCallback', 47 'PositionCallback': '_PositionCallback',
48 'PositionErrorCallback': '_PositionErrorCallback', 48 'PositionErrorCallback': '_PositionErrorCallback',
49 'RTCDTMFSender': 'RtcDtmfSender', 49 'RTCDTMFSender': 'RtcDtmfSender',
50 'RTCDTMFToneChangeEvent': 'RtcDtmfToneChangeEvent', 50 'RTCDTMFToneChangeEvent': 'RtcDtmfToneChangeEvent',
51 'RTCErrorCallback': '_RtcErrorCallback', 51 'RTCErrorCallback': '_RtcErrorCallback',
52 'RTCSessionDescriptionCallback': '_RtcSessionDescriptionCallback', 52 'RTCSessionDescriptionCallback': '_RtcSessionDescriptionCallback',
53 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. 53 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts.
54 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. 54 'SVGElement': 'SvgElement', # Manual to avoid name conflicts.
55 'SVGException': 'SvgException', # Manual of avoid conflict with Exception.
56 'SVGGradientElement': '_GradientElement', 55 'SVGGradientElement': '_GradientElement',
57 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. 56 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts.
58 'Stream': 'FileStream', 57 'Stream': 'FileStream',
59 'StringCallback': '_StringCallback', 58 'StringCallback': '_StringCallback',
60 'WebGLVertexArrayObjectOES': 'VertexArrayObject', 59 'WebGLVertexArrayObjectOES': 'VertexArrayObject',
61 'XMLHttpRequest': 'HttpRequest', 60 'XMLHttpRequest': 'HttpRequest',
62 'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent', 61 'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent',
63 'XMLHttpRequestUpload': 'HttpRequestUpload', 62 'XMLHttpRequestUpload': 'HttpRequestUpload',
64 }, **typed_array_renames)) 63 }, **typed_array_renames))
65 64
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 'Element.hasAttributeNS', 209 'Element.hasAttributeNS',
211 'ParentNode.lastElementChild', 210 'ParentNode.lastElementChild',
212 'Element.querySelectorAll', 211 'Element.querySelectorAll',
213 'Element.removeAttribute', 212 'Element.removeAttribute',
214 'Element.removeAttributeNS', 213 'Element.removeAttributeNS',
215 'Element.scrollIntoView', 214 'Element.scrollIntoView',
216 'Element.scrollIntoViewIfNeeded', 215 'Element.scrollIntoViewIfNeeded',
217 'Element.setAttributeNS', 216 'Element.setAttributeNS',
218 'Element.setAttribute', 217 'Element.setAttribute',
219 'Element.setAttributeNS', 218 'Element.setAttributeNS',
220 'ElementTraversal.childElementCount',
221 'ElementTraversal.firstElementChild',
222 'ElementTraversal.lastElementChild',
223 'Event.initEvent', 219 'Event.initEvent',
224 'EventTarget.addEventListener', 220 'EventTarget.addEventListener',
225 'EventTarget.removeEventListener', 221 'EventTarget.removeEventListener',
226 'Geolocation.clearWatch', 222 'Geolocation.clearWatch',
227 'Geolocation.getCurrentPosition', 223 'Geolocation.getCurrentPosition',
228 'Geolocation.watchPosition', 224 'Geolocation.watchPosition',
229 'HashChangeEvent.initHashChangeEvent', 225 'HashChangeEvent.initHashChangeEvent',
230 'HTMLCanvasElement.toDataURL', 226 'HTMLCanvasElement.toDataURL',
231 'HTMLTableElement.createCaption', 227 'HTMLTableElement.createCaption',
232 'HTMLTableElement.createTBody', 228 'HTMLTableElement.createTBody',
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 'UIEvent.pageY', 302 'UIEvent.pageY',
307 'WheelEvent.initWebKitWheelEvent', 303 'WheelEvent.initWebKitWheelEvent',
308 'Window.getComputedStyle', 304 'Window.getComputedStyle',
309 'Window.moveTo', 305 'Window.moveTo',
310 ]) 306 ])
311 307
312 # Members from the standard dom that exist in the dart:html library with 308 # Members from the standard dom that exist in the dart:html library with
313 # identical functionality but with cleaner names. 309 # identical functionality but with cleaner names.
314 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { 310 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', {
315 'CanvasRenderingContext2D.drawImage': '_drawImage', 311 'CanvasRenderingContext2D.drawImage': '_drawImage',
316 'CSSKeyframesRule.insertRule': 'appendRule', 312 'WebKitCSSKeyframesRule.insertRule': 'appendRule',
317 'CSSStyleDeclaration.getPropertyValue': '_getPropertyValue', 313 'CSSStyleDeclaration.getPropertyValue': '_getPropertyValue',
318 'CSSStyleDeclaration.setProperty': '_setProperty', 314 'CSSStyleDeclaration.setProperty': '_setProperty',
319 'DirectoryEntry.getDirectory': '_getDirectory', 315 'DirectoryEntry.getDirectory': '_getDirectory',
320 'DirectoryEntry.getFile': '_getFile', 316 'DirectoryEntry.getFile': '_getFile',
321 'Document.createCDATASection': 'createCDataSection', 317 'Document.createCDATASection': 'createCDataSection',
322 'Document.defaultView': 'window', 318 'Document.defaultView': 'window',
323 'Document.querySelector': 'query', 319 'Document.querySelector': 'query',
324 'Window.CSS': 'css', 320 'Window.CSS': 'css',
325 'Window.clearTimeout': '_clearTimeout', 321 'Window.clearTimeout': '_clearTimeout',
326 'Window.clearInterval': '_clearInterval', 322 'Window.clearInterval': '_clearInterval',
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 'transactionStores', 370 'transactionStores',
375 'IDBDatabase.transaction(sequence<DOMString> storeNames, DOMString mode)': 371 'IDBDatabase.transaction(sequence<DOMString> storeNames, DOMString mode)':
376 'transactionList', 372 'transactionList',
377 'IDBDatabase.transaction(DOMString storeName, DOMString mode)': 373 'IDBDatabase.transaction(DOMString storeName, DOMString mode)':
378 'transactionStore', 374 'transactionStore',
379 'RTCDataChannel.send(ArrayBuffer data)': 'sendByteBuffer', 375 'RTCDataChannel.send(ArrayBuffer data)': 'sendByteBuffer',
380 'RTCDataChannel.send(ArrayBufferView data)': 'sendTypedData', 376 'RTCDataChannel.send(ArrayBufferView data)': 'sendTypedData',
381 'RTCDataChannel.send(Blob data)': 'sendBlob', 377 'RTCDataChannel.send(Blob data)': 'sendBlob',
382 'RTCDataChannel.send(DOMString data)': 'sendString', 378 'RTCDataChannel.send(DOMString data)': 'sendString',
383 'SourceBuffer.appendBuffer(ArrayBufferView view)': 'appendBufferView', 379 'SourceBuffer.appendBuffer(ArrayBufferView view)': 'appendBufferView',
384 'URL.createObjectURL(WebKitMediaSource source)':
385 '_createObjectUrlFromWebKitMediaSource',
386 'URL.createObjectURL(MediaSource source)': 380 'URL.createObjectURL(MediaSource source)':
387 'createObjectUrlFromSource', 381 'createObjectUrlFromSource',
388 'URL.createObjectURL(MediaStream stream)': 'createObjectUrlFromStream', 382 'URL.createObjectURL(MediaStream stream)': 'createObjectUrlFromStream',
389 'URL.createObjectURL(Blob blob)': 'createObjectUrlFromBlob', 383 'URL.createObjectURL(Blob blob)': 'createObjectUrlFromBlob',
390 'WebGLRenderingContext.texImage2D(unsigned long target, long level, ' 384 'WebGLRenderingContext.texImage2D(unsigned long target, long level, '
391 'unsigned long internalformat, unsigned long format, unsigned long ' 385 'unsigned long internalformat, unsigned long format, unsigned long '
392 'type, ImageData pixels)': 'texImage2DImageData', 386 'type, ImageData pixels)': 'texImage2DImageData',
393 'WebGLRenderingContext.texImage2D(unsigned long target, long level, ' 387 'WebGLRenderingContext.texImage2D(unsigned long target, long level, '
394 'unsigned long internalformat, unsigned long format, unsigned long ' 388 'unsigned long internalformat, unsigned long format, unsigned long '
395 'type, HTMLImageElement image)': 'texImage2DImage', 389 'type, HTMLImageElement image)': 'texImage2DImage',
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 'Document.set:domain', 517 'Document.set:domain',
524 'Document.vlinkColor', 518 'Document.vlinkColor',
525 'Document.webkitCurrentFullScreenElement', 519 'Document.webkitCurrentFullScreenElement',
526 'Document.webkitFullScreenKeyboardInputAllowed', 520 'Document.webkitFullScreenKeyboardInputAllowed',
527 'Document.write', 521 'Document.write',
528 'Document.writeln', 522 'Document.writeln',
529 'Document.xmlStandalone', 523 'Document.xmlStandalone',
530 'Document.xmlVersion', 524 'Document.xmlVersion',
531 'DocumentFragment.children', 525 'DocumentFragment.children',
532 'DocumentType.*', 526 'DocumentType.*',
533 'DOMCoreException.code', 527 'DOMException.code',
534 'DOMCoreException.ABORT_ERR', 528 'DOMException.ABORT_ERR',
535 'DOMCoreException.DATA_CLONE_ERR', 529 'DOMException.DATA_CLONE_ERR',
536 'DOMCoreException.DOMSTRING_SIZE_ERR', 530 'DOMException.DOMSTRING_SIZE_ERR',
537 'DOMCoreException.HIERARCHY_REQUEST_ERR', 531 'DOMException.HIERARCHY_REQUEST_ERR',
538 'DOMCoreException.INDEX_SIZE_ERR', 532 'DOMException.INDEX_SIZE_ERR',
539 'DOMCoreException.INUSE_ATTRIBUTE_ERR', 533 'DOMException.INUSE_ATTRIBUTE_ERR',
540 'DOMCoreException.INVALID_ACCESS_ERR', 534 'DOMException.INVALID_ACCESS_ERR',
541 'DOMCoreException.INVALID_CHARACTER_ERR', 535 'DOMException.INVALID_CHARACTER_ERR',
542 'DOMCoreException.INVALID_MODIFICATION_ERR', 536 'DOMException.INVALID_MODIFICATION_ERR',
543 'DOMCoreException.INVALID_NODE_TYPE_ERR', 537 'DOMException.INVALID_NODE_TYPE_ERR',
544 'DOMCoreException.INVALID_STATE_ERR', 538 'DOMException.INVALID_STATE_ERR',
545 'DOMCoreException.NAMESPACE_ERR', 539 'DOMException.NAMESPACE_ERR',
546 'DOMCoreException.NETWORK_ERR', 540 'DOMException.NETWORK_ERR',
547 'DOMCoreException.NOT_FOUND_ERR', 541 'DOMException.NOT_FOUND_ERR',
548 'DOMCoreException.NOT_SUPPORTED_ERR', 542 'DOMException.NOT_SUPPORTED_ERR',
549 'DOMCoreException.NO_DATA_ALLOWED_ERR', 543 'DOMException.NO_DATA_ALLOWED_ERR',
550 'DOMCoreException.NO_MODIFICATION_ALLOWED_ERR', 544 'DOMException.NO_MODIFICATION_ALLOWED_ERR',
551 'DOMCoreException.QUOTA_EXCEEDED_ERR', 545 'DOMException.QUOTA_EXCEEDED_ERR',
552 'DOMCoreException.SECURITY_ERR', 546 'DOMException.SECURITY_ERR',
553 'DOMCoreException.SYNTAX_ERR', 547 'DOMException.SYNTAX_ERR',
554 'DOMCoreException.TIMEOUT_ERR', 548 'DOMException.TIMEOUT_ERR',
555 'DOMCoreException.TYPE_MISMATCH_ERR', 549 'DOMException.TYPE_MISMATCH_ERR',
556 'DOMCoreException.URL_MISMATCH_ERR', 550 'DOMException.URL_MISMATCH_ERR',
557 'DOMCoreException.VALIDATION_ERR', 551 'DOMException.VALIDATION_ERR',
558 'DOMCoreException.WRONG_DOCUMENT_ERR', 552 'DOMException.WRONG_DOCUMENT_ERR',
559 'Element.accessKey', 553 'Element.accessKey',
560 'Element.dataset', 554 'Element.dataset',
561 'Element.get:classList', 555 'Element.get:classList',
562 'Element.getAttributeNode', 556 'Element.getAttributeNode',
563 'Element.getAttributeNodeNS', 557 'Element.getAttributeNodeNS',
564 'Element.getElementsByTagNameNS', 558 'Element.getElementsByTagNameNS',
565 'Element.innerText', 559 'Element.innerText',
566 'Element.outerText', 560 'Element.outerText',
567 'Element.removeAttributeNode', 561 'Element.removeAttributeNode',
568 'Element.set:outerHTML', 562 'Element.set:outerHTML',
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 858
865 # We're looking for a sequence of letters which start with capital letter 859 # We're looking for a sequence of letters which start with capital letter
866 # then a series of caps and finishes with either the end of the string or 860 # then a series of caps and finishes with either the end of the string or
867 # a capital letter. 861 # a capital letter.
868 # The [0-9] check is for names such as 2D or 3D 862 # The [0-9] check is for names such as 2D or 3D
869 # The following test cases should match as: 863 # The following test cases should match as:
870 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 864 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
871 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 865 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
872 # IFrameElement: (I)()(F)rameElement (no change) 866 # IFrameElement: (I)()(F)rameElement (no change)
873 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 867 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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698