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

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

Issue 16234006: Chrome roll 202464->204370. (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
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 # Some types have attributes merged in from many other interfaces. 720 # Some types have attributes merged in from many other interfaces.
721 if interface.id in _library_names: 721 if interface.id in _library_names:
722 return _library_names[interface.id] 722 return _library_names[interface.id]
723 723
724 # TODO(ager, blois): The conditional has been removed from indexed db, 724 # TODO(ager, blois): The conditional has been removed from indexed db,
725 # so we can no longer determine the library based on the conditionals. 725 # so we can no longer determine the library based on the conditionals.
726 if interface.id.startswith("IDB"): 726 if interface.id.startswith("IDB"):
727 return 'indexed_db' 727 return 'indexed_db'
728 if interface.id.startswith("SQL"): 728 if interface.id.startswith("SQL"):
729 return 'web_sql' 729 return 'web_sql'
730 if interface.id.startswith("SVG"):
731 return 'svg'
732 if interface.id.startswith("WebGL") or interface.id.startswith("OES") \
733 or interface.id.startswith("EXT"):
734 return 'web_gl'
730 735
731 if 'Conditional' in interface.ext_attrs: 736 if 'Conditional' in interface.ext_attrs:
732 if 'WEB_AUDIO' in interface.ext_attrs['Conditional']: 737 if 'WEB_AUDIO' in interface.ext_attrs['Conditional']:
733 return 'web_audio' 738 return 'web_audio'
734 if 'SVG' in interface.ext_attrs['Conditional']:
735 return 'svg'
736 if 'INDEXED_DATABASE' in interface.ext_attrs['Conditional']: 739 if 'INDEXED_DATABASE' in interface.ext_attrs['Conditional']:
737 return 'indexed_db' 740 return 'indexed_db'
738 if 'SQL_DATABASE' in interface.ext_attrs['Conditional']: 741 if 'SQL_DATABASE' in interface.ext_attrs['Conditional']:
739 return 'web_sql' 742 return 'web_sql'
740 if 'WEBGL' in interface.ext_attrs['Conditional']:
741 return 'web_gl'
742 743
743 if interface.id in typed_array_renames: 744 if interface.id in typed_array_renames:
744 return 'typed_data' 745 return 'typed_data'
745 746
746 return 'html' 747 return 'html'
747 748
748 def DartifyTypeName(self, type_name): 749 def DartifyTypeName(self, type_name):
749 """Converts a DOM name to a Dart-friendly class name. """ 750 """Converts a DOM name to a Dart-friendly class name. """
750 751
751 if type_name in html_interface_renames: 752 if type_name in html_interface_renames:
(...skipping 19 matching lines...) Expand all
771 772
772 # We're looking for a sequence of letters which start with capital letter 773 # We're looking for a sequence of letters which start with capital letter
773 # then a series of caps and finishes with either the end of the string or 774 # then a series of caps and finishes with either the end of the string or
774 # a capital letter. 775 # a capital letter.
775 # The [0-9] check is for names such as 2D or 3D 776 # The [0-9] check is for names such as 2D or 3D
776 # The following test cases should match as: 777 # The following test cases should match as:
777 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue 778 # WebKitCSSFilterValue: WebKit(C)(SS)(F)ilterValue
778 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change) 779 # XPathNSResolver: (X)()(P)ath(N)(S)(R)esolver (no change)
779 # IFrameElement: (I)()(F)rameElement (no change) 780 # IFrameElement: (I)()(F)rameElement (no change)
780 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name) 781 return re.sub(r'([A-Z])([A-Z]{2,})([A-Z]|$)', toLower, name)
OLDNEW
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | tools/dom/scripts/idlnode.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698