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

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

Issue 12163009: Remove webkit prefix and annotate with experimental tag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 5
6 """This module provides shared functionality for systems to generate 6 """This module provides shared functionality for systems to generate
7 Dart APIs from the IDL database.""" 7 Dart APIs from the IDL database."""
8 8
9 import copy 9 import copy
10 import json 10 import json
11 import os 11 import os
12 import re 12 import re
13 from htmlrenamer import html_interface_renames 13 from htmlrenamer import html_interface_renames, renamed_html_members
14 14
15 # Set up json file for retrieving comments. 15 # Set up json file for retrieving comments.
16 _current_dir = os.path.dirname(__file__) 16 _current_dir = os.path.dirname(__file__)
17 _json_path = os.path.join(_current_dir, '..', 'docs', 'docs.json') 17 _json_path = os.path.join(_current_dir, '..', 'docs', 'docs.json')
18 _dom_json = json.load(open(_json_path)) 18 _dom_json = json.load(open(_json_path))
19 19
20 _pure_interfaces = set([ 20 _pure_interfaces = set([
21 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>. 21 # TODO(sra): DOMStringMap should be a class implementing Map<String,String>.
22 'DOMStringMap', 22 'DOMStringMap',
23 'ElementTimeControl', 23 'ElementTimeControl',
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 annotations = ["@DomName('" + key + "')"] 885 annotations = ["@DomName('" + key + "')"]
886 886
887 # Only add this for members, so we don't add DocsEditable to templated classes 887 # Only add this for members, so we don't add DocsEditable to templated classes
888 # (they get it from the default class template) 888 # (they get it from the default class template)
889 if member_name: 889 if member_name:
890 annotations.append('@DocsEditable'); 890 annotations.append('@DocsEditable');
891 891
892 if (dart_annotations.get(key) != None): 892 if (dart_annotations.get(key) != None):
893 annotations.extend(dart_annotations.get(key)) 893 annotations.extend(dart_annotations.get(key))
894 894
895 if (member_name and member_name.startswith('webkit') and
896 key not in renamed_html_members):
897 annotations.extend(_webkit_experimental_annotations)
898
895 return annotations 899 return annotations
896 900
897 def FindDart2JSAnnotationsAndComments(idl_type, library_name, interface_name, 901 def FindDart2JSAnnotationsAndComments(idl_type, library_name, interface_name,
898 member_name,): 902 member_name,):
899 """ Finds all annotations for Dart2JS members- including annotations for 903 """ Finds all annotations for Dart2JS members- including annotations for
900 both dart2js and dartium. 904 both dart2js and dartium.
901 """ 905 """
902 annotations = GetAnnotationsAndComments(library_name, interface_name, member_n ame) 906 annotations = GetAnnotationsAndComments(library_name, interface_name, member_n ame)
903 907
904 ann2 = _FindDart2JSSpecificAnnotations(idl_type, interface_name, member_name) 908 ann2 = _FindDart2JSSpecificAnnotations(idl_type, interface_name, member_name)
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 self) 1479 self)
1476 1480
1477 if type_data.clazz == 'SVGTearOff': 1481 if type_data.clazz == 'SVGTearOff':
1478 dart_interface_name = self._renamer.RenameInterface( 1482 dart_interface_name = self._renamer.RenameInterface(
1479 self._database.GetInterface(type_name)) 1483 self._database.GetInterface(type_name))
1480 return SVGTearOffIDLTypeInfo( 1484 return SVGTearOffIDLTypeInfo(
1481 type_name, type_data, dart_interface_name, self) 1485 type_name, type_data, dart_interface_name, self)
1482 1486
1483 class_name = '%sIDLTypeInfo' % type_data.clazz 1487 class_name = '%sIDLTypeInfo' % type_data.clazz
1484 return globals()[class_name](type_name, type_data) 1488 return globals()[class_name](type_name, type_data)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698