| 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 | 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 'SVGUseElement': 'use', | 253 'SVGUseElement': 'use', |
| 254 'SVGViewElement': 'view', | 254 'SVGViewElement': 'view', |
| 255 'SVGVKernElement': 'vkern', | 255 'SVGVKernElement': 'vkern', |
| 256 }) | 256 }) |
| 257 | 257 |
| 258 _element_constructors = { | 258 _element_constructors = { |
| 259 'html': _html_element_constructors, | 259 'html': _html_element_constructors, |
| 260 'indexed_db': {}, | 260 'indexed_db': {}, |
| 261 'svg': _svg_element_constructors, | 261 'svg': _svg_element_constructors, |
| 262 'web_audio': {}, | 262 'web_audio': {}, |
| 263 'web_sql': {}, |
| 263 } | 264 } |
| 264 | 265 |
| 265 _factory_ctr_strings = { | 266 _factory_ctr_strings = { |
| 266 'html': { | 267 'html': { |
| 267 'provider_name': 'document', | 268 'provider_name': 'document', |
| 268 'constructor_name': '$dom_createElement' | 269 'constructor_name': '$dom_createElement' |
| 269 }, | 270 }, |
| 270 'indexed_db': { | 271 'indexed_db': { |
| 271 'provider_name': 'document', | 272 'provider_name': 'document', |
| 272 'constructor_name': '$dom_createElement' | 273 'constructor_name': '$dom_createElement' |
| 273 }, | 274 }, |
| 274 'svg': { | 275 'svg': { |
| 275 'provider_name': '_SvgElementFactoryProvider', | 276 'provider_name': '_SvgElementFactoryProvider', |
| 276 'constructor_name': 'createSvgElement_tag', | 277 'constructor_name': 'createSvgElement_tag', |
| 277 }, | 278 }, |
| 278 'web_audio': { | 279 'web_audio': { |
| 279 'provider_name': 'document', | 280 'provider_name': 'document', |
| 280 'constructor_name': '$dom_createElement' | 281 'constructor_name': '$dom_createElement' |
| 281 }, | 282 }, |
| 283 'web_sql': { |
| 284 'provider_name': 'document', |
| 285 'constructor_name': '$dom_createElement' |
| 286 }, |
| 282 } | 287 } |
| 283 | 288 |
| 284 def ElementConstructorInfos(typename, element_constructors, | 289 def ElementConstructorInfos(typename, element_constructors, |
| 285 factory_provider_name='_Elements'): | 290 factory_provider_name='_Elements'): |
| 286 """Returns list of ElementConstructorInfos about the convenience constructors | 291 """Returns list of ElementConstructorInfos about the convenience constructors |
| 287 for an Element or SvgElement.""" | 292 for an Element or SvgElement.""" |
| 288 # TODO(sra): Handle multiple and named constructors. | 293 # TODO(sra): Handle multiple and named constructors. |
| 289 if typename not in element_constructors: | 294 if typename not in element_constructors: |
| 290 return [] | 295 return [] |
| 291 infos = element_constructors[typename] | 296 infos = element_constructors[typename] |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 for library_name in libraries: | 1115 for library_name in libraries: |
| 1111 self._libraries[library_name] = DartLibrary( | 1116 self._libraries[library_name] = DartLibrary( |
| 1112 library_name, template_loader, library_type, output_dir) | 1117 library_name, template_loader, library_type, output_dir) |
| 1113 | 1118 |
| 1114 def AddFile(self, basename, library_name, path): | 1119 def AddFile(self, basename, library_name, path): |
| 1115 self._libraries[library_name].AddFile(path) | 1120 self._libraries[library_name].AddFile(path) |
| 1116 | 1121 |
| 1117 def Emit(self, emitter, auxiliary_dir): | 1122 def Emit(self, emitter, auxiliary_dir): |
| 1118 for lib in self._libraries.values(): | 1123 for lib in self._libraries.values(): |
| 1119 lib.Emit(emitter, auxiliary_dir) | 1124 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |