| 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', |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 'Rect': 'CssRect', | 34 'Rect': 'CssRect', |
| 35 'RGBColor': 'CssRgbColor', | 35 'RGBColor': 'CssRgbColor', |
| 36 'RTCDTMFSender': 'RtcDtmfSender', | 36 'RTCDTMFSender': 'RtcDtmfSender', |
| 37 'RTCDTMFToneChangeEvent': 'RtcDtmfToneChangeEvent', | 37 'RTCDTMFToneChangeEvent': 'RtcDtmfToneChangeEvent', |
| 38 'RTCErrorCallback': '_RtcErrorCallback', | 38 'RTCErrorCallback': '_RtcErrorCallback', |
| 39 'RTCSessionDescriptionCallback': '_RtcSessionDescriptionCallback', | 39 'RTCSessionDescriptionCallback': '_RtcSessionDescriptionCallback', |
| 40 'StringCallback': '_StringCallback', | 40 'StringCallback': '_StringCallback', |
| 41 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. | 41 'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts. |
| 42 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. | 42 'SVGElement': 'SvgElement', # Manual to avoid name conflicts. |
| 43 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. | 43 'SVGException': 'SvgException', # Manual of avoid conflict with Exception. |
| 44 'SVGGradientElement': '_GradientElement', |
| 44 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. | 45 'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts. |
| 45 'WebGLVertexArrayObjectOES': 'VertexArrayObject', | 46 'WebGLVertexArrayObjectOES': 'VertexArrayObject', |
| 46 'WebKitAnimationEvent': 'AnimationEvent', | 47 'WebKitAnimationEvent': 'AnimationEvent', |
| 47 'WebKitCSSKeyframeRule': 'CssKeyframeRule', | 48 'WebKitCSSKeyframeRule': 'CssKeyframeRule', |
| 48 'WebKitCSSKeyframesRule': 'CssKeyframesRule', | 49 'WebKitCSSKeyframesRule': 'CssKeyframesRule', |
| 49 'WebKitCSSMatrix': 'CssMatrix', | 50 'WebKitCSSMatrix': 'CssMatrix', |
| 50 'WebKitCSSTransformValue': 'CssTransformValue', | 51 'WebKitCSSTransformValue': 'CssTransformValue', |
| 51 'WebKitPoint': 'DomPoint', | 52 'WebKitPoint': 'DomPoint', |
| 52 'WebKitTransitionEvent': '_WebKitTransitionEvent', | 53 'WebKitTransitionEvent': '_WebKitTransitionEvent', |
| 53 'XMLHttpRequest': 'HttpRequest', | 54 'XMLHttpRequest': 'HttpRequest', |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 'SVGCursorElement', # Webkit only. | 86 'SVGCursorElement', # Webkit only. |
| 86 'SVGFEDropShadowElement', # Webkit only for the following: | 87 'SVGFEDropShadowElement', # Webkit only for the following: |
| 87 'SVGFontElement', | 88 'SVGFontElement', |
| 88 'SVGFontFaceElement', | 89 'SVGFontFaceElement', |
| 89 'SVGFontFaceFormatElement', | 90 'SVGFontFaceFormatElement', |
| 90 'SVGFontFaceNameElement', | 91 'SVGFontFaceNameElement', |
| 91 'SVGFontFaceSrcElement', | 92 'SVGFontFaceSrcElement', |
| 92 'SVGFontFaceUriElement', | 93 'SVGFontFaceUriElement', |
| 93 'SVGGlyphElement', | 94 'SVGGlyphElement', |
| 94 'SVGGlyphRefElement', | 95 'SVGGlyphRefElement', |
| 95 'SVGGradientElement', # Currently not supported anywhere. | |
| 96 'SVGHKernElement', | 96 'SVGHKernElement', |
| 97 'SVGMPathElement', | 97 'SVGMPathElement', |
| 98 'SVGMissingGlyphElement', | 98 'SVGMissingGlyphElement', |
| 99 'SVGTRefElement', | 99 'SVGTRefElement', |
| 100 'SVGVKernElement', | 100 'SVGVKernElement', |
| 101 'SharedWorker', # Workers | 101 'SharedWorker', # Workers |
| 102 'SharedWorkerContext', # Workers | 102 'SharedWorkerContext', # Workers |
| 103 'WorkerContext', # Workers | 103 'WorkerContext', # Workers |
| 104 'WorkerLocation', # Workers | 104 'WorkerLocation', # Workers |
| 105 'WorkerNavigator', # Workers | 105 'WorkerNavigator', # Workers |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 | 666 |
| 667 def ShouldSuppressMember(self, interface, member, member_prefix=''): | 667 def ShouldSuppressMember(self, interface, member, member_prefix=''): |
| 668 """ Returns true if the member should be suppressed.""" | 668 """ Returns true if the member should be suppressed.""" |
| 669 if self._FindMatch(interface, member, member_prefix, | 669 if self._FindMatch(interface, member, member_prefix, |
| 670 _removed_html_members): | 670 _removed_html_members): |
| 671 return True | 671 return True |
| 672 if interface.id in _removed_html_interfaces: | 672 if interface.id in _removed_html_interfaces: |
| 673 return True | 673 return True |
| 674 return False | 674 return False |
| 675 | 675 |
| 676 def ShouldSuppressInterface(self, interface): |
| 677 """ Returns true if the interface should be suppressed.""" |
| 678 if interface.id in _removed_html_interfaces: |
| 679 return True |
| 680 |
| 676 def _FindMatch(self, interface, member, member_prefix, candidates): | 681 def _FindMatch(self, interface, member, member_prefix, candidates): |
| 677 for interface in self._database.Hierarchy(interface): | 682 for interface in self._database.Hierarchy(interface): |
| 678 member_name = interface.id + '.' + member | 683 member_name = interface.id + '.' + member |
| 679 if member_name in candidates: | 684 if member_name in candidates: |
| 680 return member_name | 685 return member_name |
| 681 member_name = interface.id + '.' + member_prefix + member | 686 member_name = interface.id + '.' + member_prefix + member |
| 682 if member_name in candidates: | 687 if member_name in candidates: |
| 683 return member_name | 688 return member_name |
| 684 member_name = interface.id + '.*' | 689 member_name = interface.id + '.*' |
| 685 if member_name in candidates: | 690 if member_name in candidates: |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 734 |
| 730 # We're looking for a sequence of letters which start with capital letter | 735 # We're looking for a sequence of letters which start with capital letter |
| 731 # then a series of caps and finishes with either the end of the string or | 736 # then a series of caps and finishes with either the end of the string or |
| 732 # a capital letter. | 737 # a capital letter. |
| 733 # The [0-9] check is for names such as 2D or 3D | 738 # The [0-9] check is for names such as 2D or 3D |
| 734 # The following test cases should match as: | 739 # The following test cases should match as: |
| 735 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 740 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 736 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 741 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 737 # IFrameElement: (I)()(F)rameElement (no change) | 742 # IFrameElement: (I)()(F)rameElement (no change) |
| 738 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 743 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |