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

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

Issue 16494002: Expand overloaded methods and optional parameters in the html library. (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
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 the system to generate 6 """This module provides shared functionality for the system to generate
7 Dart:html APIs from the IDL database.""" 7 Dart:html APIs from the IDL database."""
8 8
9 import emitter 9 import emitter
10 import monitored 10 import monitored
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 'Element.insertAdjacentElement', 46 'Element.insertAdjacentElement',
47 'Element.insertAdjacentHTML', 47 'Element.insertAdjacentHTML',
48 'Element.insertAdjacentText', 48 'Element.insertAdjacentText',
49 'Element.webkitMatchesSelector', 49 'Element.webkitMatchesSelector',
50 'Element.remove', 50 'Element.remove',
51 'ElementEvents.mouseWheel', 51 'ElementEvents.mouseWheel',
52 'ElementEvents.transitionEnd', 52 'ElementEvents.transitionEnd',
53 'DOMException.name', 53 'DOMException.name',
54 'HTMLTableElement.createTBody', 54 'HTMLTableElement.createTBody',
55 'IDBDatabase.transaction', 55 'IDBDatabase.transaction',
56 'IDBDatabase.transactionList',
57 'IDBDatabase.transactionStringList',
56 'KeyboardEvent.initKeyboardEvent', 58 'KeyboardEvent.initKeyboardEvent',
57 'Location.origin', 59 'Location.origin',
58 'MouseEvent.offsetX', 60 'MouseEvent.offsetX',
59 'MouseEvent.offsetY', 61 'MouseEvent.offsetY',
60 'Navigator.language', 62 'Navigator.language',
61 'Navigator.webkitGetUserMedia', 63 'Navigator.webkitGetUserMedia',
62 'ScriptProcessorNode._setEventListener', 64 'ScriptProcessorNode._setEventListener',
63 'URL.createObjectURL', 65 'URL.createObjectURL',
66 'URL.createObjectUrlFromStream',
67 'URL.createObjectUrlFromBlob',
64 'URL.revokeObjectURL', 68 'URL.revokeObjectURL',
65 'WheelEvent.deltaMode', 69 'WheelEvent.deltaMode',
66 'WheelEvent.wheelDeltaX', 70 'WheelEvent.wheelDeltaX',
67 'WheelEvent.wheelDeltaY', 71 'WheelEvent.wheelDeltaY',
68 'Window.cancelAnimationFrame', 72 'Window.cancelAnimationFrame',
69 'Window.console', 73 'Window.console',
70 'Window.document', 74 'Window.document',
71 'Window.indexedDB', 75 'Window.indexedDB',
72 'Window.location', 76 'Window.location',
73 'Window.open', 77 'Window.open',
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 947
944 parameter_names = [param_info.name for param_info in info.param_infos] 948 parameter_names = [param_info.name for param_info in info.param_infos]
945 parameter_types = [InputType(param_info.type_id) 949 parameter_types = [InputType(param_info.type_id)
946 for param_info in info.param_infos] 950 for param_info in info.param_infos]
947 operations = info.operations 951 operations = info.operations
948 952
949 temp_version = [0] 953 temp_version = [0]
950 954
951 def GenerateCall( 955 def GenerateCall(
952 stmts_emitter, call_emitter, version, operation, argument_count): 956 stmts_emitter, call_emitter, version, operation, argument_count):
953 target = '_%s_%d' % (html_name, version); 957 target = '_%s_%d' % (
958 html_name[1:] if html_name.startswith('_') else html_name, version);
954 arguments = [] 959 arguments = []
955 target_parameters = [] 960 target_parameters = []
956 for position, arg in enumerate(operation.arguments[:argument_count]): 961 for position, arg in enumerate(operation.arguments[:argument_count]):
957 conversion = self._InputConversion(arg.type.id, operation.id) 962 conversion = self._InputConversion(arg.type.id, operation.id)
958 param_name = operation.arguments[position].id 963 param_name = operation.arguments[position].id
959 if conversion: 964 if conversion:
960 temp_version[0] += 1 965 temp_version[0] += 1
961 temp_name = '%s_%s' % (param_name, temp_version[0]) 966 temp_name = '%s_%s' % (param_name, temp_version[0])
962 temp_type = conversion.output_type 967 temp_type = conversion.output_type
963 stmts_emitter.Emit( 968 stmts_emitter.Emit(
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 for library_name in libraries: 1181 for library_name in libraries:
1177 self._libraries[library_name] = DartLibrary( 1182 self._libraries[library_name] = DartLibrary(
1178 library_name, template_loader, library_type, output_dir) 1183 library_name, template_loader, library_type, output_dir)
1179 1184
1180 def AddFile(self, basename, library_name, path): 1185 def AddFile(self, basename, library_name, path):
1181 self._libraries[library_name].AddFile(path) 1186 self._libraries[library_name].AddFile(path)
1182 1187
1183 def Emit(self, emitter, auxiliary_dir): 1188 def Emit(self, emitter, auxiliary_dir):
1184 for lib in self._libraries.values(): 1189 for lib in self._libraries.values():
1185 lib.Emit(emitter, auxiliary_dir) 1190 lib.Emit(emitter, auxiliary_dir)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698