| 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 typed_array_renames = { | 9 typed_array_renames = { |
| 10 'ArrayBuffer': 'ByteBuffer', | 10 'ArrayBuffer': 'ByteBuffer', |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 if 'SVG' in interface.ext_attrs['Conditional']: | 720 if 'SVG' in interface.ext_attrs['Conditional']: |
| 721 return 'svg' | 721 return 'svg' |
| 722 if 'INDEXED_DATABASE' in interface.ext_attrs['Conditional']: | 722 if 'INDEXED_DATABASE' in interface.ext_attrs['Conditional']: |
| 723 return 'indexed_db' | 723 return 'indexed_db' |
| 724 if 'SQL_DATABASE' in interface.ext_attrs['Conditional']: | 724 if 'SQL_DATABASE' in interface.ext_attrs['Conditional']: |
| 725 return 'web_sql' | 725 return 'web_sql' |
| 726 if 'WEBGL' in interface.ext_attrs['Conditional']: | 726 if 'WEBGL' in interface.ext_attrs['Conditional']: |
| 727 return 'web_gl' | 727 return 'web_gl' |
| 728 | 728 |
| 729 if interface.id in typed_array_renames: | 729 if interface.id in typed_array_renames: |
| 730 return 'typeddata' | 730 return 'typed_data' |
| 731 | 731 |
| 732 return 'html' | 732 return 'html' |
| 733 | 733 |
| 734 def DartifyTypeName(self, type_name): | 734 def DartifyTypeName(self, type_name): |
| 735 """Converts a DOM name to a Dart-friendly class name. """ | 735 """Converts a DOM name to a Dart-friendly class name. """ |
| 736 | 736 |
| 737 if type_name in html_interface_renames: | 737 if type_name in html_interface_renames: |
| 738 return html_interface_renames[type_name] | 738 return html_interface_renames[type_name] |
| 739 | 739 |
| 740 # Strip off any standard prefixes. | 740 # Strip off any standard prefixes. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 756 | 756 |
| 757 # We're looking for a sequence of letters which start with capital letter | 757 # We're looking for a sequence of letters which start with capital letter |
| 758 # then a series of caps and finishes with either the end of the string or | 758 # then a series of caps and finishes with either the end of the string or |
| 759 # a capital letter. | 759 # a capital letter. |
| 760 # The [0-9] check is for names such as 2D or 3D | 760 # The [0-9] check is for names such as 2D or 3D |
| 761 # The following test cases should match as: | 761 # The following test cases should match as: |
| 762 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue | 762 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue |
| 763 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) | 763 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) |
| 764 # IFrameElement: (I)()(F)rameElement (no change) | 764 # IFrameElement: (I)()(F)rameElement (no change) |
| 765 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) | 765 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) |
| OLD | NEW |