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/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, 5 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 | « tools/dom/scripts/monitored.py ('k') | tools/dom/templates/html/dart2js/impl_URL.darttemplate » ('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 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 logging 10 import logging
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 'Element.insertAdjacentElement', 51 'Element.insertAdjacentElement',
52 'Element.insertAdjacentHTML', 52 'Element.insertAdjacentHTML',
53 'Element.insertAdjacentText', 53 'Element.insertAdjacentText',
54 'Element.webkitMatchesSelector', 54 'Element.webkitMatchesSelector',
55 'Element.remove', 55 'Element.remove',
56 'ElementEvents.mouseWheel', 56 'ElementEvents.mouseWheel',
57 'ElementEvents.transitionEnd', 57 'ElementEvents.transitionEnd',
58 'DOMException.name', 58 'DOMException.name',
59 'HTMLTableElement.createTBody', 59 'HTMLTableElement.createTBody',
60 'IDBDatabase.transaction', 60 'IDBDatabase.transaction',
61 'IDBDatabase.transactionList',
62 'IDBDatabase.transactionStore',
63 'IDBDatabase.transactionStores',
61 'KeyboardEvent.initKeyboardEvent', 64 'KeyboardEvent.initKeyboardEvent',
62 'Location.origin', 65 'Location.origin',
63 'MouseEvent.offsetX', 66 'MouseEvent.offsetX',
64 'MouseEvent.offsetY', 67 'MouseEvent.offsetY',
65 'Navigator.language', 68 'Navigator.language',
66 'Navigator.webkitGetUserMedia', 69 'Navigator.webkitGetUserMedia',
67 'ScriptProcessorNode._setEventListener', 70 'ScriptProcessorNode._setEventListener',
68 'URL.createObjectURL', 71 'URL.createObjectURL',
72 'URL.createObjectUrlFromSource',
73 'URL.createObjectUrlFromStream',
74 'URL.createObjectUrlFromBlob',
69 'URL.revokeObjectURL', 75 'URL.revokeObjectURL',
70 'WheelEvent.deltaMode', 76 'WheelEvent.deltaMode',
71 'WheelEvent.wheelDeltaX', 77 'WheelEvent.wheelDeltaX',
72 'WheelEvent.wheelDeltaY', 78 'WheelEvent.wheelDeltaY',
73 'Window.cancelAnimationFrame', 79 'Window.cancelAnimationFrame',
74 'Window.console', 80 'Window.console',
75 'Window.document', 81 'Window.document',
76 'Window.indexedDB', 82 'Window.indexedDB',
77 'Window.location', 83 'Window.location',
78 'Window.open', 84 'Window.open',
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 954
949 parameter_names = [param_info.name for param_info in info.param_infos] 955 parameter_names = [param_info.name for param_info in info.param_infos]
950 parameter_types = [InputType(param_info.type_id) 956 parameter_types = [InputType(param_info.type_id)
951 for param_info in info.param_infos] 957 for param_info in info.param_infos]
952 operations = info.operations 958 operations = info.operations
953 959
954 temp_version = [0] 960 temp_version = [0]
955 961
956 def GenerateCall( 962 def GenerateCall(
957 stmts_emitter, call_emitter, version, operation, argument_count): 963 stmts_emitter, call_emitter, version, operation, argument_count):
958 target = '_%s_%d' % (html_name, version); 964 target = '_%s_%d' % (
965 html_name[1:] if html_name.startswith('_') else html_name, version);
959 arguments = [] 966 arguments = []
960 target_parameters = [] 967 target_parameters = []
961 for position, arg in enumerate(operation.arguments[:argument_count]): 968 for position, arg in enumerate(operation.arguments[:argument_count]):
962 conversion = self._InputConversion(arg.type.id, operation.id) 969 conversion = self._InputConversion(arg.type.id, operation.id)
963 param_name = operation.arguments[position].id 970 param_name = operation.arguments[position].id
964 if conversion: 971 if conversion:
965 temp_version[0] += 1 972 temp_version[0] += 1
966 temp_name = '%s_%s' % (param_name, temp_version[0]) 973 temp_name = '%s_%s' % (param_name, temp_version[0])
967 temp_type = conversion.output_type 974 temp_type = conversion.output_type
968 stmts_emitter.Emit( 975 stmts_emitter.Emit(
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 for library_name in libraries: 1195 for library_name in libraries:
1189 self._libraries[library_name] = DartLibrary( 1196 self._libraries[library_name] = DartLibrary(
1190 library_name, template_loader, library_type, output_dir) 1197 library_name, template_loader, library_type, output_dir)
1191 1198
1192 def AddFile(self, basename, library_name, path): 1199 def AddFile(self, basename, library_name, path):
1193 self._libraries[library_name].AddFile(path) 1200 self._libraries[library_name].AddFile(path)
1194 1201
1195 def Emit(self, emitter, auxiliary_dir): 1202 def Emit(self, emitter, auxiliary_dir):
1196 for lib in self._libraries.values(): 1203 for lib in self._libraries.values():
1197 lib.Emit(emitter, auxiliary_dir) 1204 lib.Emit(emitter, auxiliary_dir)
OLDNEW
« no previous file with comments | « tools/dom/scripts/monitored.py ('k') | tools/dom/templates/html/dart2js/impl_URL.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698