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

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

Issue 569783002: Migrate to Chrome 37 IDL (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/htmldartgenerator.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 'WebGLVertexArrayObjectOES': 'VertexArrayObject', 61 'WebGLVertexArrayObjectOES': 'VertexArrayObject',
62 'WindowTimers': '_WindowTimers', 62 'WindowTimers': '_WindowTimers',
63 'XMLHttpRequest': 'HttpRequest', 63 'XMLHttpRequest': 'HttpRequest',
64 'XMLHttpRequestUpload': 'HttpRequestUpload', 64 'XMLHttpRequestUpload': 'HttpRequestUpload',
65 'XMLHttpRequestEventTarget': 'HttpRequestEventTarget', 65 'XMLHttpRequestEventTarget': 'HttpRequestEventTarget',
66 }, **typed_array_renames)) 66 }, **typed_array_renames))
67 67
68 # 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
69 # properly wrap DOM objects if/when encountered. 69 # properly wrap DOM objects if/when encountered.
70 _removed_html_interfaces = [ 70 _removed_html_interfaces = [
71 'CanvasPathMethods',
71 'CDataSection', 72 'CDataSection',
72 'CSSPrimitiveValue', 73 'CSSPrimitiveValue',
73 'CSSUnknownRule', 74 'CSSUnknownRule',
74 'CSSValue', 75 'CSSValue',
75 'Counter', 76 'Counter',
76 'DOMFileSystemSync', # Workers 77 'DOMFileSystemSync', # Workers
77 'DatabaseSync', # Workers 78 'DatabaseSync', # Workers
78 'DataView', # Typed arrays 79 'DataView', # Typed arrays
79 'DirectoryEntrySync', # Workers 80 'DirectoryEntrySync', # Workers
80 'DirectoryReaderSync', # Workers 81 'DirectoryReaderSync', # Workers
(...skipping 11 matching lines...) Expand all
92 'HTMLFrameSetElement', 93 'HTMLFrameSetElement',
93 'HTMLMarqueeElement', 94 'HTMLMarqueeElement',
94 'IDBAny', 95 'IDBAny',
95 'MutationEvent', 96 'MutationEvent',
96 'Notation', 97 'Notation',
97 'NotificationCenter', 98 'NotificationCenter',
98 'PagePopupController', 99 'PagePopupController',
99 'RGBColor', 100 'RGBColor',
100 'RadioNodeList', # Folded onto NodeList in dart2js. 101 'RadioNodeList', # Folded onto NodeList in dart2js.
101 'Rect', 102 'Rect',
103 'Response', # TODO: Symbol conflicts with Angular: dartbug.com/20937
102 'ServiceWorker', 104 'ServiceWorker',
103 'SQLTransactionSync', # Workers 105 'SQLTransactionSync', # Workers
104 'SQLTransactionSyncCallback', # Workers 106 'SQLTransactionSyncCallback', # Workers
105 'SVGAltGlyphDefElement', # Webkit only. 107 'SVGAltGlyphDefElement', # Webkit only.
106 'SVGAltGlyphItemElement', # Webkit only. 108 'SVGAltGlyphItemElement', # Webkit only.
107 'SVGAnimateColorElement', # Deprecated. Use AnimateElement instead. 109 'SVGAnimateColorElement', # Deprecated. Use AnimateElement instead.
108 'SVGColor', 110 'SVGColor',
109 'SVGComponentTransferFunctionElement', # Currently not supported anywhere. 111 'SVGComponentTransferFunctionElement', # Currently not supported anywhere.
110 'SVGCursorElement', # Webkit only. 112 'SVGCursorElement', # Webkit only.
111 'SVGFEDropShadowElement', # Webkit only for the following: 113 'SVGFEDropShadowElement', # Webkit only for the following:
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 'Element.clientLeft', 248 'Element.clientLeft',
247 'Element.clientTop', 249 'Element.clientTop',
248 'Element.clientWidth', 250 'Element.clientWidth',
249 'Element.clientHeight', 251 'Element.clientHeight',
250 'Element.scrollLeft', 252 'Element.scrollLeft',
251 'Element.scrollTop', 253 'Element.scrollTop',
252 'Element.scrollWidth', 254 'Element.scrollWidth',
253 'Element.scrollHeight', 255 'Element.scrollHeight',
254 256
255 'Event.initEvent', 257 'Event.initEvent',
258 'EventTarget.addEventListener',
259 'EventTarget.removeEventListener',
256 'FileReader.result', 260 'FileReader.result',
257 'Geolocation.clearWatch', 261 'Geolocation.clearWatch',
258 'Geolocation.getCurrentPosition', 262 'Geolocation.getCurrentPosition',
259 'Geolocation.watchPosition', 263 'Geolocation.watchPosition',
260 'HashChangeEvent.initHashChangeEvent', 264 'HashChangeEvent.initHashChangeEvent',
261 'HTMLCanvasElement.toDataURL', 265 'HTMLCanvasElement.toDataURL',
262 'HTMLTableElement.createCaption', 266 'HTMLTableElement.createCaption',
263 'HTMLTableElement.createTFoot', 267 'HTMLTableElement.createTFoot',
264 'HTMLTableElement.createTHead', 268 'HTMLTableElement.createTHead',
265 'HTMLTableElement.createTBody', 269 'HTMLTableElement.createTBody',
(...skipping 22 matching lines...) Expand all
288 'IDBObjectStore.delete', 292 'IDBObjectStore.delete',
289 'IDBObjectStore.get', 293 'IDBObjectStore.get',
290 'IDBObjectStore.openCursor', 294 'IDBObjectStore.openCursor',
291 'IDBObjectStore.put', 295 'IDBObjectStore.put',
292 'KeyboardEvent.initKeyboardEvent', 296 'KeyboardEvent.initKeyboardEvent',
293 'KeyboardEvent.keyIdentifier', 297 'KeyboardEvent.keyIdentifier',
294 'MessageEvent.initMessageEvent', 298 'MessageEvent.initMessageEvent',
295 'MouseEvent.initMouseEvent', 299 'MouseEvent.initMouseEvent',
296 'MouseEvent.clientX', 300 'MouseEvent.clientX',
297 'MouseEvent.clientY', 301 'MouseEvent.clientY',
302 'MouseEvent.movementX',
303 'MouseEvent.movementY',
298 'MouseEvent.webkitMovementX', 304 'MouseEvent.webkitMovementX',
299 'MouseEvent.webkitMovementY', 305 'MouseEvent.webkitMovementY',
300 'MouseEvent.offsetX', 306 'MouseEvent.offsetX',
301 'MouseEvent.offsetY', 307 'MouseEvent.offsetY',
302 'MouseEvent.screenX', 308 'MouseEvent.screenX',
303 'MouseEvent.screenY', 309 'MouseEvent.screenY',
304 'MutationEvent.initMutationEvent', 310 'MutationEvent.initMutationEvent',
305 'MutationObserver.observe', 311 'MutationObserver.observe',
306 'Node.attributes', 312 'Node.attributes',
307 'Node.localName', 313 'Node.localName',
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 'RTCDataChannel.send(ArrayBufferView data)': 'sendTypedData', 422 'RTCDataChannel.send(ArrayBufferView data)': 'sendTypedData',
417 'RTCDataChannel.send(Blob data)': 'sendBlob', 423 'RTCDataChannel.send(Blob data)': 'sendBlob',
418 'RTCDataChannel.send(DOMString data)': 'sendString', 424 'RTCDataChannel.send(DOMString data)': 'sendString',
419 'SourceBuffer.appendBuffer(ArrayBufferView data)': 'appendTypedData', 425 'SourceBuffer.appendBuffer(ArrayBufferView data)': 'appendTypedData',
420 'URL.createObjectURL(MediaSource source)': 426 'URL.createObjectURL(MediaSource source)':
421 'createObjectUrlFromSource', 427 'createObjectUrlFromSource',
422 'URL.createObjectURL(WebKitMediaSource source)': 428 'URL.createObjectURL(WebKitMediaSource source)':
423 '_createObjectUrlFromWebKitSource', 429 '_createObjectUrlFromWebKitSource',
424 'URL.createObjectURL(MediaStream stream)': 'createObjectUrlFromStream', 430 'URL.createObjectURL(MediaStream stream)': 'createObjectUrlFromStream',
425 'URL.createObjectURL(Blob blob)': 'createObjectUrlFromBlob', 431 'URL.createObjectURL(Blob blob)': 'createObjectUrlFromBlob',
426 'WebGLRenderingContext.texImage2D(unsigned long target, long level, ' 432 'WebGLRenderingContextBase.texImage2D(unsigned long target, long level, '
427 'unsigned long internalformat, unsigned long format, unsigned long ' 433 'unsigned long internalformat, unsigned long format, unsigned long '
428 'type, ImageData pixels)': 'texImage2DImageData', 434 'type, ImageData pixels)': 'texImage2DImageData',
429 'WebGLRenderingContext.texImage2D(unsigned long target, long level, ' 435 'WebGLRenderingContextBase.texImage2D(unsigned long target, long level, '
430 'unsigned long internalformat, unsigned long format, unsigned long ' 436 'unsigned long internalformat, unsigned long format, unsigned long '
431 'type, HTMLImageElement image)': 'texImage2DImage', 437 'type, HTMLImageElement image)': 'texImage2DImage',
432 'WebGLRenderingContext.texImage2D(unsigned long target, long level, ' 438 'WebGLRenderingContextBase.texImage2D(unsigned long target, long level, '
433 'unsigned long internalformat, unsigned long format, unsigned long ' 439 'unsigned long internalformat, unsigned long format, unsigned long '
434 'type, HTMLCanvasElement canvas)': 'texImage2DCanvas', 440 'type, HTMLCanvasElement canvas)': 'texImage2DCanvas',
435 'WebGLRenderingContext.texImage2D(unsigned long target, long level, ' 441 'WebGLRenderingContextBase.texImage2D(unsigned long target, long level, '
436 'unsigned long internalformat, unsigned long format, unsigned long ' 442 'unsigned long internalformat, unsigned long format, unsigned long '
437 'type, HTMLVideoElement video)': 'texImage2DVideo', 443 'type, HTMLVideoElement video)': 'texImage2DVideo',
438 'WebGLRenderingContext.texSubImage2D(unsigned long target, long level, ' 444 'WebGLRenderingContextBase.texSubImage2D(unsigned long target, long level, '
439 'long xoffset, long yoffset, unsigned long format, unsigned long type, ' 445 'long xoffset, long yoffset, unsigned long format, unsigned long type, '
440 'ImageData pixels)': 'texSubImage2DImageData', 446 'ImageData pixels)': 'texSubImage2DImageData',
441 'WebGLRenderingContext.texSubImage2D(unsigned long target, long level, ' 447 'WebGLRenderingContextBase.texSubImage2D(unsigned long target, long level, '
442 'long xoffset, long yoffset, unsigned long format, unsigned long type, ' 448 'long xoffset, long yoffset, unsigned long format, unsigned long type, '
443 'HTMLImageElement image)': 'texSubImage2DImage', 449 'HTMLImageElement image)': 'texSubImage2DImage',
444 'WebGLRenderingContext.texSubImage2D(unsigned long target, long level, ' 450 'WebGLRenderingContextBase.texSubImage2D(unsigned long target, long level, '
445 'long xoffset, long yoffset, unsigned long format, unsigned long type, ' 451 'long xoffset, long yoffset, unsigned long format, unsigned long type, '
446 'HTMLCanvasElement canvas)': 'texSubImage2DCanvas', 452 'HTMLCanvasElement canvas)': 'texSubImage2DCanvas',
447 'WebGLRenderingContext.texSubImage2D(unsigned long target, long level, ' 453 'WebGLRenderingContextBase.texSubImage2D(unsigned long target, long level, '
448 'long xoffset, long yoffset, unsigned long format, unsigned long type, ' 454 'long xoffset, long yoffset, unsigned long format, unsigned long type, '
449 'HTMLVideoElement video)': 'texSubImage2DVideo', 455 'HTMLVideoElement video)': 'texSubImage2DVideo',
450 'WebGLRenderingContext.bufferData(unsigned long target, ArrayBuffer data, ' 456 'WebGLRenderingContextBase.bufferData(unsigned long target, '
451 'unsigned long usage)': 'bufferByteData', 457 'ArrayBuffer data, unsigned long usage)': 'bufferByteData',
452 'WebGLRenderingContext.bufferData(unsigned long target, ' 458 'WebGLRenderingContextBase.bufferData(unsigned long target, '
453 'ArrayBufferView data, unsigned long usage)': 'bufferDataTyped', 459 'ArrayBufferView data, unsigned long usage)': 'bufferDataTyped',
454 'WebGLRenderingContext.bufferSubData(unsigned long target, ' 460 'WebGLRenderingContextBase.bufferSubData(unsigned long target, '
455 'long long offset, ArrayBuffer data)': 'bufferSubByteData', 461 'long long offset, ArrayBuffer data)': 'bufferSubByteData',
456 'WebGLRenderingContext.bufferSubData(unsigned long target, ' 462 'WebGLRenderingContextBase.bufferSubData(unsigned long target, '
457 'long long offset, ArrayBufferView data)': 'bufferSubDataTyped', 463 'long long offset, ArrayBufferView data)': 'bufferSubDataTyped',
458 'WebSocket.send(ArrayBuffer data)': 'sendByteBuffer', 464 'WebSocket.send(ArrayBuffer data)': 'sendByteBuffer',
459 'WebSocket.send(ArrayBufferView data)': 'sendTypedData', 465 'WebSocket.send(ArrayBufferView data)': 'sendTypedData',
460 'WebSocket.send(DOMString data)': 'sendString', 466 'WebSocket.send(DOMString data)': 'sendString',
461 'WebSocket.send(Blob data)': 'sendBlob' 467 'WebSocket.send(Blob data)': 'sendBlob'
462 }) 468 })
463 469
464 # Members that have multiple definitions, but their types are identical (only 470 # Members that have multiple definitions, but their types are identical (only
465 # number of arguments vary), so we do not rename them as a _raw method. 471 # number of arguments vary), so we do not rename them as a _raw method.
466 keep_overloaded_members = monitored.Set( 472 keep_overloaded_members = monitored.Set(
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 1001
996 # 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
997 # 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
998 # a capital letter. 1004 # a capital letter.
999 # 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
1000 # The following test cases should match as: 1006 # The following test cases should match as:
1001 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 1007 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
1002 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 1008 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
1003 # IFrameElement: (I)()(F)rameElement (no change) 1009 # IFrameElement: (I)()(F)rameElement (no change)
1004 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/htmldartgenerator.py ('k') | tools/dom/scripts/idlnode.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698