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

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

Issue 23889005: Cleaning up a bunch of DOM generation tables (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/htmleventgenerator.py ('k') | tools/dom/scripts/systemhtml.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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 'SVGFontFaceUriElement', 108 'SVGFontFaceUriElement',
109 'SVGGlyphElement', 109 'SVGGlyphElement',
110 'SVGGlyphRefElement', 110 'SVGGlyphRefElement',
111 'SVGHKernElement', 111 'SVGHKernElement',
112 'SVGMPathElement', 112 'SVGMPathElement',
113 'SVGPaint', 113 'SVGPaint',
114 'SVGMissingGlyphElement', 114 'SVGMissingGlyphElement',
115 'SVGTRefElement', 115 'SVGTRefElement',
116 'SVGVKernElement', 116 'SVGVKernElement',
117 'SharedWorker', # Workers 117 'SharedWorker', # Workers
118 'SubtleCrypto',
118 'WebKitMediaSource', 119 'WebKitMediaSource',
119 'WebKitSourceBuffer', 120 'WebKitSourceBuffer',
120 'WebKitSourceBufferList', 121 'WebKitSourceBufferList',
121 'WorkerLocation', # Workers 122 'WorkerLocation', # Workers
122 'WorkerNavigator', # Workers 123 'WorkerNavigator', # Workers
123 ] 124 ]
124 125
125 for interface in _removed_html_interfaces: 126 for interface in _removed_html_interfaces:
126 html_interface_renames[interface] = '_' + interface 127 html_interface_renames[interface] = '_' + interface
127 128
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 'Window.moveTo', 324 'Window.moveTo',
324 'Window.clearTimeout', 325 'Window.clearTimeout',
325 'Window.clearInterval', 326 'Window.clearInterval',
326 'Window.setTimeout', 327 'Window.setTimeout',
327 'Window.setInterval', 328 'Window.setInterval',
328 ]) 329 ])
329 330
330 # Members from the standard dom that exist in the dart:html library with 331 # Members from the standard dom that exist in the dart:html library with
331 # identical functionality but with cleaner names. 332 # identical functionality but with cleaner names.
332 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', { 333 renamed_html_members = monitored.Dict('htmlrenamer.renamed_html_members', {
333 'WebKitCSSKeyframesRule.insertRule': 'appendRule', 334 'CSSKeyframesRule.insertRule': 'appendRule',
334 'DirectoryEntry.getDirectory': '_getDirectory', 335 'DirectoryEntry.getDirectory': '_getDirectory',
335 'DirectoryEntry.getFile': '_getFile', 336 'DirectoryEntry.getFile': '_getFile',
336 'Document.createCDATASection': 'createCDataSection', 337 'Document.createCDATASection': 'createCDataSection',
337 'Document.defaultView': 'window', 338 'Document.defaultView': 'window',
338 'Document.querySelector': 'query', 339 'Document.querySelector': 'query',
339 'Window.CSS': 'css', 340 'Window.CSS': 'css',
340 'Window.webkitConvertPointFromNodeToPage': '_convertPointFromNodeToPage', 341 'Window.webkitConvertPointFromNodeToPage': '_convertPointFromNodeToPage',
341 'Window.webkitConvertPointFromPageToNode': '_convertPointFromPageToNode', 342 'Window.webkitConvertPointFromPageToNode': '_convertPointFromPageToNode',
342 'Window.webkitNotifications': 'notifications', 343 'Window.webkitNotifications': 'notifications',
343 'Window.webkitRequestFileSystem': '_requestFileSystem', 344 'Window.webkitRequestFileSystem': '_requestFileSystem',
(...skipping 18 matching lines...) Expand all
362 }) 363 })
363 364
364 # Members that have multiple definitions, but their types are vary, so we rename 365 # Members that have multiple definitions, but their types are vary, so we rename
365 # them to make them distinct. 366 # them to make them distinct.
366 renamed_overloads = monitored.Dict('htmldartgenreator.renamed_overloads', { 367 renamed_overloads = monitored.Dict('htmldartgenreator.renamed_overloads', {
367 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)': 368 'AudioContext.createBuffer(ArrayBuffer buffer, boolean mixToMono)':
368 'createBufferFromBuffer', 369 'createBufferFromBuffer',
369 'CSS.supports(DOMString conditionText)': 'supportsCondition', 370 'CSS.supports(DOMString conditionText)': 'supportsCondition',
370 'CanvasRenderingContext2D.createPattern(HTMLImageElement image, ' 371 'CanvasRenderingContext2D.createPattern(HTMLImageElement image, '
371 'DOMString repetitionType)': 'createPatternFromImage', 372 'DOMString repetitionType)': 'createPatternFromImage',
372 'CryptoOperation.process(ArrayBuffer data)': 'processByteBuffer',
373 'CryptoOperation.process(ArrayBufferView data)': 'processTypedData',
374 'DataTransferItemList.add(File file)': 'addFile', 373 'DataTransferItemList.add(File file)': 'addFile',
375 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData', 374 'DataTransferItemList.add(DOMString data, DOMString type)': 'addData',
376 'FormData.append(DOMString name, Blob value, DOMString filename)': 375 'FormData.append(DOMString name, Blob value, DOMString filename)':
377 'appendBlob', 376 'appendBlob',
378 'IDBDatabase.transaction(DOMStringList storeNames, DOMString mode)': 377 'IDBDatabase.transaction(DOMStringList storeNames, DOMString mode)':
379 'transactionStores', 378 'transactionStores',
380 'IDBDatabase.transaction(sequence<DOMString> storeNames, DOMString mode)': 379 'IDBDatabase.transaction(sequence<DOMString> storeNames, DOMString mode)':
381 'transactionList', 380 'transactionList',
382 'IDBDatabase.transaction(DOMString storeName, DOMString mode)': 381 'IDBDatabase.transaction(DOMString storeName, DOMString mode)':
383 'transactionStore', 382 'transactionStore',
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 'CanvasRenderingContext2D.setMiterLimit', 487 'CanvasRenderingContext2D.setMiterLimit',
489 'CanvasRenderingContext2D.setShadow', 488 'CanvasRenderingContext2D.setShadow',
490 'CanvasRenderingContext2D.setStrokeColor', 489 'CanvasRenderingContext2D.setStrokeColor',
491 'CharacterData.remove', 490 'CharacterData.remove',
492 'Window.call:blur', 491 'Window.call:blur',
493 'Window.call:focus', 492 'Window.call:focus',
494 'Window.clientInformation', 493 'Window.clientInformation',
495 'Window.get:frames', 494 'Window.get:frames',
496 'Window.get:length', 495 'Window.get:length',
497 'Window.on:beforeUnload', 496 'Window.on:beforeUnload',
497 'Window.on:webkitTransitionEnd',
498 'Window.pagePopupController', 498 'Window.pagePopupController',
499 'Window.prompt', 499 'Window.prompt',
500 'Window.webkitCancelAnimationFrame', 500 'Window.webkitCancelAnimationFrame',
501 'Window.webkitCancelRequestAnimationFrame', 501 'Window.webkitCancelRequestAnimationFrame',
502 'Window.webkitIndexedDB', 502 'Window.webkitIndexedDB',
503 'Window.webkitRequestAnimationFrame', 503 'Window.webkitRequestAnimationFrame',
504 'Document.alinkColor', 504 'Document.alinkColor',
505 'Document.all', 505 'Document.all',
506 'Document.applets', 506 'Document.applets',
507 'Document.bgColor', 507 'Document.bgColor',
(...skipping 21 matching lines...) Expand all
529 'Document.get:links', 529 'Document.get:links',
530 'Document.get:plugins', 530 'Document.get:plugins',
531 'Document.get:scripts', 531 'Document.get:scripts',
532 'Document.get:xmlEncoding', 532 'Document.get:xmlEncoding',
533 'Document.getElementsByTagNameNS', 533 'Document.getElementsByTagNameNS',
534 'Document.getOverrideStyle', 534 'Document.getOverrideStyle',
535 'Document.getSelection', 535 'Document.getSelection',
536 'Document.images', 536 'Document.images',
537 'Document.linkColor', 537 'Document.linkColor',
538 'Document.location', 538 'Document.location',
539 'Document.on:wheel',
539 'Document.open', 540 'Document.open',
540 'Document.register', 541 'Document.register',
541 'Document.set:domain', 542 'Document.set:domain',
542 'Document.vlinkColor', 543 'Document.vlinkColor',
543 'Document.webkitCurrentFullScreenElement', 544 'Document.webkitCurrentFullScreenElement',
544 'Document.webkitFullScreenKeyboardInputAllowed', 545 'Document.webkitFullScreenKeyboardInputAllowed',
545 'Document.webkitRegister',
546 'Document.write', 546 'Document.write',
547 'Document.writeln', 547 'Document.writeln',
548 'Document.xmlStandalone', 548 'Document.xmlStandalone',
549 'Document.xmlVersion', 549 'Document.xmlVersion',
550 'DocumentFragment.children', 550 'DocumentFragment.children',
551 'DocumentType.*', 551 'DocumentType.*',
552 'DOMException.code', 552 'DOMException.code',
553 'DOMException.ABORT_ERR', 553 'DOMException.ABORT_ERR',
554 'DOMException.DATA_CLONE_ERR', 554 'DOMException.DATA_CLONE_ERR',
555 'DOMException.DOMSTRING_SIZE_ERR', 555 'DOMException.DOMSTRING_SIZE_ERR',
(...skipping 19 matching lines...) Expand all
575 'DOMException.URL_MISMATCH_ERR', 575 'DOMException.URL_MISMATCH_ERR',
576 'DOMException.VALIDATION_ERR', 576 'DOMException.VALIDATION_ERR',
577 'DOMException.WRONG_DOCUMENT_ERR', 577 'DOMException.WRONG_DOCUMENT_ERR',
578 'Element.accessKey', 578 'Element.accessKey',
579 'Element.dataset', 579 'Element.dataset',
580 'Element.get:classList', 580 'Element.get:classList',
581 'Element.getAttributeNode', 581 'Element.getAttributeNode',
582 'Element.getAttributeNodeNS', 582 'Element.getAttributeNodeNS',
583 'Element.getElementsByTagNameNS', 583 'Element.getElementsByTagNameNS',
584 'Element.innerText', 584 'Element.innerText',
585 'Element.on:wheel',
585 'Element.outerText', 586 'Element.outerText',
586 'Element.removeAttributeNode', 587 'Element.removeAttributeNode',
587 'Element.set:outerHTML', 588 'Element.set:outerHTML',
588 'Element.setAttributeNode', 589 'Element.setAttributeNode',
589 'Element.setAttributeNodeNS', 590 'Element.setAttributeNodeNS',
590 'Element.webkitCreateShadowRoot', 591 'Element.webkitCreateShadowRoot',
591 'Element.webkitPseudo', 592 'Element.webkitPseudo',
592 'Element.webkitShadowRoot', 593 'Element.webkitShadowRoot',
593 'Event.returnValue', 594 'Event.returnValue',
594 'Event.srcElement', 595 'Event.srcElement',
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 'NodeList.item', 728 'NodeList.item',
728 'Performance.webkitClearMarks', 729 'Performance.webkitClearMarks',
729 'Performance.webkitClearMeasures', 730 'Performance.webkitClearMeasures',
730 'Performance.webkitGetEntries', 731 'Performance.webkitGetEntries',
731 'Performance.webkitGetEntriesByName', 732 'Performance.webkitGetEntriesByName',
732 'Performance.webkitGetEntriesByType', 733 'Performance.webkitGetEntriesByType',
733 'Performance.webkitMark', 734 'Performance.webkitMark',
734 'Performance.webkitMeasure', 735 'Performance.webkitMeasure',
735 'ShadowRoot.getElementsByTagNameNS', 736 'ShadowRoot.getElementsByTagNameNS',
736 'SVGElement.getPresentationAttribute', 737 'SVGElement.getPresentationAttribute',
737 'SVGStyledElement.getPresentationAttribute', 738 'SVGElementInstance.on:wheel',
738 'WheelEvent.wheelDelta', 739 'WheelEvent.wheelDelta',
740 'Window.on:wheel',
739 'WorkerGlobalScope.webkitIndexedDB', 741 'WorkerGlobalScope.webkitIndexedDB',
740 # TODO(jacobr): should these be removed? 742 # TODO(jacobr): should these be removed?
741 'Document.close', 743 'Document.close',
742 'Document.hasFocus', 744 'Document.hasFocus',
743 ]) 745 ])
744 746
745 # Manual dart: library name lookup. 747 # Manual dart: library name lookup.
746 _library_names = monitored.Dict('htmlrenamer._library_names', { 748 _library_names = monitored.Dict('htmlrenamer._library_names', {
747 'ANGLEInstancedArrays': 'web_gl', 749 'ANGLEInstancedArrays': 'web_gl',
748 'Database': 'web_sql', 750 'Database': 'web_sql',
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 899
898 # We're looking for a sequence of letters which start with capital letter 900 # We're looking for a sequence of letters which start with capital letter
899 # then a series of caps and finishes with either the end of the string or 901 # then a series of caps and finishes with either the end of the string or
900 # a capital letter. 902 # a capital letter.
901 # The [0-9] check is for names such as 2D or 3D 903 # The [0-9] check is for names such as 2D or 3D
902 # The following test cases should match as: 904 # The following test cases should match as:
903 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 905 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
904 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 906 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
905 # IFrameElement: (I)()(F)rameElement (no change) 907 # IFrameElement: (I)()(F)rameElement (no change)
906 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 908 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmleventgenerator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698