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

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: Created 7 years, 5 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
« tools/dom/dom.json ('K') | « 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 'Document.set:domain', 519 'Document.set:domain',
524 'Document.vlinkColor', 520 'Document.vlinkColor',
525 'Document.webkitCurrentFullScreenElement', 521 'Document.webkitCurrentFullScreenElement',
526 'Document.webkitFullScreenKeyboardInputAllowed', 522 'Document.webkitFullScreenKeyboardInputAllowed',
527 'Document.write', 523 'Document.write',
528 'Document.writeln', 524 'Document.writeln',
529 'Document.xmlStandalone', 525 'Document.xmlStandalone',
530 'Document.xmlVersion', 526 'Document.xmlVersion',
531 'DocumentFragment.children', 527 'DocumentFragment.children',
532 'DocumentType.*', 528 'DocumentType.*',
533 'DOMCoreException.code', 529 'DOMException.code',
534 'DOMCoreException.ABORT_ERR', 530 'DOMException.ABORT_ERR',
535 'DOMCoreException.DATA_CLONE_ERR', 531 'DOMException.DATA_CLONE_ERR',
536 'DOMCoreException.DOMSTRING_SIZE_ERR', 532 'DOMException.DOMSTRING_SIZE_ERR',
537 'DOMCoreException.HIERARCHY_REQUEST_ERR', 533 'DOMException.HIERARCHY_REQUEST_ERR',
538 'DOMCoreException.INDEX_SIZE_ERR', 534 'DOMException.INDEX_SIZE_ERR',
539 'DOMCoreException.INUSE_ATTRIBUTE_ERR', 535 'DOMException.INUSE_ATTRIBUTE_ERR',
540 'DOMCoreException.INVALID_ACCESS_ERR', 536 'DOMException.INVALID_ACCESS_ERR',
541 'DOMCoreException.INVALID_CHARACTER_ERR', 537 'DOMException.INVALID_CHARACTER_ERR',
542 'DOMCoreException.INVALID_MODIFICATION_ERR', 538 'DOMException.INVALID_MODIFICATION_ERR',
543 'DOMCoreException.INVALID_NODE_TYPE_ERR', 539 'DOMException.INVALID_NODE_TYPE_ERR',
544 'DOMCoreException.INVALID_STATE_ERR', 540 'DOMException.INVALID_STATE_ERR',
545 'DOMCoreException.NAMESPACE_ERR', 541 'DOMException.NAMESPACE_ERR',
546 'DOMCoreException.NETWORK_ERR', 542 'DOMException.NETWORK_ERR',
547 'DOMCoreException.NOT_FOUND_ERR', 543 'DOMException.NOT_FOUND_ERR',
548 'DOMCoreException.NOT_SUPPORTED_ERR', 544 'DOMException.NOT_SUPPORTED_ERR',
549 'DOMCoreException.NO_DATA_ALLOWED_ERR', 545 'DOMException.NO_DATA_ALLOWED_ERR',
550 'DOMCoreException.NO_MODIFICATION_ALLOWED_ERR', 546 'DOMException.NO_MODIFICATION_ALLOWED_ERR',
551 'DOMCoreException.QUOTA_EXCEEDED_ERR', 547 'DOMException.QUOTA_EXCEEDED_ERR',
552 'DOMCoreException.SECURITY_ERR', 548 'DOMException.SECURITY_ERR',
553 'DOMCoreException.SYNTAX_ERR', 549 'DOMException.SYNTAX_ERR',
554 'DOMCoreException.TIMEOUT_ERR', 550 'DOMException.TIMEOUT_ERR',
555 'DOMCoreException.TYPE_MISMATCH_ERR', 551 'DOMException.TYPE_MISMATCH_ERR',
556 'DOMCoreException.URL_MISMATCH_ERR', 552 'DOMException.URL_MISMATCH_ERR',
557 'DOMCoreException.VALIDATION_ERR', 553 'DOMException.VALIDATION_ERR',
558 'DOMCoreException.WRONG_DOCUMENT_ERR', 554 'DOMException.WRONG_DOCUMENT_ERR',
559 'Element.accessKey', 555 'Element.accessKey',
560 'Element.dataset', 556 'Element.dataset',
561 'Element.get:classList', 557 'Element.get:classList',
562 'Element.getAttributeNode', 558 'Element.getAttributeNode',
563 'Element.getAttributeNodeNS', 559 'Element.getAttributeNodeNS',
564 'Element.getElementsByTagNameNS', 560 'Element.getElementsByTagNameNS',
565 'Element.innerText', 561 'Element.innerText',
566 'Element.outerText', 562 'Element.outerText',
567 'Element.removeAttributeNode', 563 'Element.removeAttributeNode',
568 'Element.set:outerHTML', 564 'Element.set:outerHTML',
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 860
865 # We're looking for a sequence of letters which start with capital letter 861 # 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 862 # then a series of caps and finishes with either the end of the string or
867 # a capital letter. 863 # a capital letter.
868 # The [0-9] check is for names such as 2D or 3D 864 # The [0-9] check is for names such as 2D or 3D
869 # The following test cases should match as: 865 # The following test cases should match as:
870 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 866 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
871 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 867 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
872 # IFrameElement: (I)()(F)rameElement (no change) 868 # IFrameElement: (I)()(F)rameElement (no change)
873 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 869 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW
« tools/dom/dom.json ('K') | « tools/dom/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698