Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { | 9 html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', { |
| 10 'CDATASection': 'CDataSection', | 10 'CDATASection': 'CDataSection', |
| 11 'DOMApplicationCache': 'ApplicationCache', | 11 'DOMApplicationCache': 'ApplicationCache', |
| 12 'DOMCoreException': 'DomException', | 12 'DOMCoreException': 'DomException', |
| 13 'DOMFileSystem': 'FileSystem', | 13 'DOMFileSystem': 'FileSystem', |
| 14 'DOMFileSystemSync': 'FileSystemSync', | 14 'DOMFileSystemSync': 'FileSystemSync', |
| 15 'DOMFormData': 'FormData', | 15 'DOMFormData': 'FormData', |
| 16 'DOMURL': 'Url', | 16 'DOMURL': 'Url', |
| 17 'DOMWindow': 'Window', | 17 'DOMWindow': 'Window', |
| 18 'HTMLAppletElement' : '_AppletElement', | |
| 19 'HTMLBaseFontElement' : '_BaseFontElement', | |
| 20 'HTMLDirectoryElement' : '_DirectoryElement', | |
| 21 'HTMLDocument' : 'HtmlDocument', | 18 'HTMLDocument' : 'HtmlDocument', |
| 22 'HTMLFontElement' : '_FontElement', | |
| 23 'HTMLFrameElement' : '_FrameElement', | |
| 24 'HTMLFrameSetElement' : '_FrameSetElement', | |
| 25 'HTMLMarqueeElement' : '_MarqueeElement', | |
| 26 'IDBAny': '_Any', # Suppressed, but needs to exist for Dartium. | |
| 27 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. | 19 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts. |
| 28 'NavigatorUserMediaErrorCallback': '_NavigatorUserMediaErrorCallback', | 20 'NavigatorUserMediaErrorCallback': '_NavigatorUserMediaErrorCallback', |
| 29 'NavigatorUserMediaSuccessCallback': '_NavigatorUserMediaSuccessCallback', | 21 'NavigatorUserMediaSuccessCallback': '_NavigatorUserMediaSuccessCallback', |
| 30 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. | 22 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. |
| 31 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. | 23 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. |
| 32 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. | 24 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. |
| 33 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. | 25 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. |
| 34 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject', | 26 'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject', |
| 35 'WebKitAnimationEvent': 'AnimationEvent', | 27 'WebKitAnimationEvent': 'AnimationEvent', |
| 36 'WebKitCSSKeyframeRule': 'CssKeyframeRule', | 28 'WebKitCSSKeyframeRule': 'CssKeyframeRule', |
| 37 'WebKitCSSKeyframesRule': 'CssKeyframesRule', | 29 'WebKitCSSKeyframesRule': 'CssKeyframesRule', |
| 38 'WebKitCSSMatrix': 'CssMatrix', | 30 'WebKitCSSMatrix': 'CssMatrix', |
| 39 'WebKitCSSTransformValue': 'CssTransformValue', | 31 'WebKitCSSTransformValue': 'CssTransformValue', |
| 40 'WebKitPoint': 'Point', | 32 'WebKitPoint': 'Point', |
| 41 'WebKitTransitionEvent': 'TransitionEvent', | 33 'WebKitTransitionEvent': 'TransitionEvent', |
| 42 'XMLHttpRequest': 'HttpRequest', | 34 'XMLHttpRequest': 'HttpRequest', |
| 43 'XMLHttpRequestException': 'HttpRequestException', | 35 'XMLHttpRequestException': 'HttpRequestException', |
| 44 'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent', | 36 'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent', |
| 45 'XMLHttpRequestUpload': 'HttpRequestUpload', | 37 'XMLHttpRequestUpload': 'HttpRequestUpload', |
| 46 }) | 38 }) |
| 47 | 39 |
| 40 # Interfaces that are suppressed, but need to still exist for Dartium. | |
|
blois
2013/01/24 23:20:47
Dartium and to properly wrap DOM objects if/when e
| |
| 41 _removed_html_interfaces = [ | |
| 42 'HTMLAppletElement', | |
| 43 'HTMLBaseFontElement', | |
| 44 'HTMLDirectoryElement', | |
| 45 'HTMLFontElement', | |
| 46 'HTMLFrameElement', | |
| 47 'HTMLFrameSetElement', | |
| 48 'HTMLMarqueeElement', | |
| 49 'IDBAny', | |
| 50 'SVGAltGlyphDefElement', # Webkit only. | |
| 51 'SVGAltGlyphItemElement', # Webkit only. | |
| 52 'SVGAnimateColorElement', # Deprecated. Use AnimateElement instead. | |
| 53 'SVGComponentTransferFunctionElement', # Currently not supported anywhere. | |
| 54 'SVGCursorElement', # Webkit only. | |
| 55 'SVGGradientElement', # Currently not supported anywhere. | |
| 56 'SVGFEDropShadowElement', # Webkit only for the following: | |
| 57 'SVGFontElement', | |
| 58 'SVGFontFaceElement', | |
| 59 'SVGFontFaceFormatElement', | |
| 60 'SVGFontFaceNameElement', | |
| 61 'SVGFontFaceSrcElement', | |
| 62 'SVGFontFaceUriElement', | |
| 63 'SVGGlyphElement', | |
| 64 'SVGGlyphRefElement', | |
| 65 'SVGHKernElement', | |
| 66 'SVGMissingGlyphElement', | |
| 67 'SVGMPathElement', | |
| 68 'SVGTRefElement', | |
| 69 'SVGVKernElement', | |
| 70 ] | |
| 71 | |
| 72 for interface in _removed_html_interfaces: | |
| 73 html_interface_renames[interface] = '_' + interface | |
| 74 | |
| 48 # Members from the standard dom that should not be exposed publicly in dart:html | 75 # Members from the standard dom that should not be exposed publicly in dart:html |
| 49 # but need to be exposed internally to implement dart:html on top of a standard | 76 # but need to be exposed internally to implement dart:html on top of a standard |
| 50 # browser. | 77 # browser. |
| 51 _private_html_members = monitored.Set('htmlrenamer._private_html_members', [ | 78 _private_html_members = monitored.Set('htmlrenamer._private_html_members', [ |
| 52 'CompositionEvent.initCompositionEvent', | 79 'CompositionEvent.initCompositionEvent', |
| 53 'CustomEvent.initCustomEvent', | 80 'CustomEvent.initCustomEvent', |
| 54 'DeviceOrientationEvent.initDeviceOrientationEvent', | 81 'DeviceOrientationEvent.initDeviceOrientationEvent', |
| 55 'Document.createElement', | 82 'Document.createElement', |
| 56 'Document.createElementNS', | 83 'Document.createElementNS', |
| 57 'Document.createEvent', | 84 'Document.createEvent', |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 | 571 |
| 545 # We're looking for a sequence of letters which start with capital letter | 572 # We're looking for a sequence of letters which start with capital letter |
| 546 # then a series of caps and finishes with either the end of the string or | 573 # then a series of caps and finishes with either the end of the string or |
| 547 # a capital letter. | 574 # a capital letter. |
| 548 # The [0-9] check is for names such as 2D or 3D | 575 # The [0-9] check is for names such as 2D or 3D |
| 549 # The following test cases should match as: | 576 # The following test cases should match as: |
| 550 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 577 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 551 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 578 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 552 # IFrameElement: (I)()(F)rameElement (no change) | 579 # IFrameElement: (I)()(F)rameElement (no change) |
| 553 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 580 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |