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

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

Issue 15814008: Cleaning up some DOM APIs which were marked as deprecated because they were moved or renamed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
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',
11 'ArrayBufferView': 'TypedData', 11 'ArrayBufferView': 'TypedData',
12 'DataView': 'ByteData', 12 'DataView': 'ByteData',
13 'Float32Array': 'Float32List', 13 'Float32Array': 'Float32List',
14 'Float64Array': 'Float64List', 14 'Float64Array': 'Float64List',
15 'Int8Array': 'Int8List', 15 'Int8Array': 'Int8List',
16 'Int16Array': 'Int16List', 16 'Int16Array': 'Int16List',
17 'Int32Array': 'Int32List', 17 'Int32Array': 'Int32List',
18 'Uint8Array': 'Uint8List', 18 'Uint8Array': 'Uint8List',
19 'Uint8ClampedArray': 'Uint8ClampedList', 19 'Uint8ClampedArray': 'Uint8ClampedList',
20 'Uint16Array': 'Uint16List', 20 'Uint16Array': 'Uint16List',
21 'Uint32Array': 'Uint32List', 21 'Uint32Array': 'Uint32List',
22 } 22 }
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 'CDATASection': 'CDataSection', 27 'CDATASection': 'CDataSection',
27 'Clipboard': 'DataTransfer', 28 'Clipboard': 'DataTransfer',
28 'Database': 'SqlDatabase', # Avoid conflict with Index DB's Database. 29 'Database': 'SqlDatabase', # Avoid conflict with Index DB's Database.
29 'DatabaseSync': 'SqlDatabaseSync', 30 'DatabaseSync': 'SqlDatabaseSync',
30 'DOMApplicationCache': 'ApplicationCache', 31 'DOMApplicationCache': 'ApplicationCache',
31 'DOMFileSystem': 'FileSystem', 32 'DOMFileSystem': 'FileSystem',
32 'DOMPoint': '_DomPoint', 33 'DOMPoint': '_DomPoint',
33 'EntryCallback': '_EntryCallback', 34 'EntryCallback': '_EntryCallback',
34 'EntriesCallback': '_EntriesCallback', 35 'EntriesCallback': '_EntriesCallback',
35 'ErrorCallback': '_ErrorCallback', 36 'ErrorCallback': '_ErrorCallback',
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 'MouseEvent.webkitMovementY', 264 'MouseEvent.webkitMovementY',
264 'MouseEvent.offsetX', 265 'MouseEvent.offsetX',
265 'MouseEvent.offsetY', 266 'MouseEvent.offsetY',
266 'MouseEvent.screenX', 267 'MouseEvent.screenX',
267 'MouseEvent.screenY', 268 'MouseEvent.screenY',
268 'MutationEvent.initMutationEvent', 269 'MutationEvent.initMutationEvent',
269 'Node.attributes', 270 'Node.attributes',
270 'Node.childNodes', 271 'Node.childNodes',
271 'Node.firstChild', 272 'Node.firstChild',
272 'Node.lastChild', 273 'Node.lastChild',
274 'Node.localName',
273 'Node.namespaceURI', 275 'Node.namespaceURI',
274 'Node.removeChild', 276 'Node.removeChild',
275 'Node.replaceChild', 277 'Node.replaceChild',
276 'Screen.availHeight', 278 'Screen.availHeight',
277 'Screen.availLeft', 279 'Screen.availLeft',
278 'Screen.availTop', 280 'Screen.availTop',
279 'Screen.availWidth', 281 'Screen.availWidth',
280 'Storage.clear', 282 'Storage.clear',
281 'Storage.getItem', 283 'Storage.getItem',
282 'Storage.key', 284 'Storage.key',
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 renamed_html_members[member] = '_' + member[member.find('.') + 1 :] 358 renamed_html_members[member] = '_' + member[member.find('.') + 1 :]
357 359
358 # Members and classes from the dom that should be removed completely from 360 # Members and classes from the dom that should be removed completely from
359 # dart:html. These could be expressed in the IDL instead but expressing this 361 # dart:html. These could be expressed in the IDL instead but expressing this
360 # as a simple table instead is more concise. 362 # as a simple table instead is more concise.
361 # Syntax is: ClassName.(get\:|set\:|call\:|on\:)?MemberName 363 # Syntax is: ClassName.(get\:|set\:|call\:|on\:)?MemberName
362 # Using get: and set: is optional and should only be used when a getter needs 364 # Using get: and set: is optional and should only be used when a getter needs
363 # to be suppressed but not the setter, etc. 365 # to be suppressed but not the setter, etc.
364 # TODO(jacobr): cleanup and augment this list. 366 # TODO(jacobr): cleanup and augment this list.
365 _removed_html_members = monitored.Set('htmlrenamer._removed_html_members', [ 367 _removed_html_members = monitored.Set('htmlrenamer._removed_html_members', [
366 'Attr.*',
367 'AudioBufferSourceNode.looping', # TODO(vsm): Use deprecated IDL annotation 368 'AudioBufferSourceNode.looping', # TODO(vsm): Use deprecated IDL annotation
368 'CSSStyleDeclaration.getPropertyCSSValue', 369 'CSSStyleDeclaration.getPropertyCSSValue',
369 'CanvasRenderingContext2D.clearShadow', 370 'CanvasRenderingContext2D.clearShadow',
370 'CanvasRenderingContext2D.drawImageFromRect', 371 'CanvasRenderingContext2D.drawImageFromRect',
371 'CanvasRenderingContext2D.setAlpha', 372 'CanvasRenderingContext2D.setAlpha',
372 'CanvasRenderingContext2D.setCompositeOperation', 373 'CanvasRenderingContext2D.setCompositeOperation',
373 'CanvasRenderingContext2D.setFillColor', 374 'CanvasRenderingContext2D.setFillColor',
374 'CanvasRenderingContext2D.setLineCap', 375 'CanvasRenderingContext2D.setLineCap',
375 'CanvasRenderingContext2D.setLineJoin', 376 'CanvasRenderingContext2D.setLineJoin',
376 'CanvasRenderingContext2D.setLineWidth', 377 'CanvasRenderingContext2D.setLineWidth',
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 769
769 # We're looking for a sequence of letters which start with capital letter 770 # We're looking for a sequence of letters which start with capital letter
770 # then a series of caps and finishes with either the end of the string or 771 # then a series of caps and finishes with either the end of the string or
771 # a capital letter. 772 # a capital letter.
772 # The [0-9] check is for names such as 2D or 3D 773 # The [0-9] check is for names such as 2D or 3D
773 # The following test cases should match as: 774 # The following test cases should match as:
774 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 775 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
775 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 776 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
776 # IFrameElement: (I)()(F)rameElement (no change) 777 # IFrameElement: (I)()(F)rameElement (no change)
777 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 778 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698