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 os | 10 import os |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 'HTMLKeygenElement': "Element.isTagSupported('keygen') " | 78 'HTMLKeygenElement': "Element.isTagSupported('keygen') " |
79 "&& (new Element.tag('keygen') is KeygenElement)", | 79 "&& (new Element.tag('keygen') is KeygenElement)", |
80 'HTMLMarqueeElement': "Element.isTagSupported('marquee')" | 80 'HTMLMarqueeElement': "Element.isTagSupported('marquee')" |
81 "&& (new Element.tag('marquee') is MarqueeElement)", | 81 "&& (new Element.tag('marquee') is MarqueeElement)", |
82 'HTMLMeterElement': "Element.isTagSupported('meter')", | 82 'HTMLMeterElement': "Element.isTagSupported('meter')", |
83 'HTMLObjectElement': "Element.isTagSupported('object')", | 83 'HTMLObjectElement': "Element.isTagSupported('object')", |
84 'HTMLOutputElement': "Element.isTagSupported('output')", | 84 'HTMLOutputElement': "Element.isTagSupported('output')", |
85 'HTMLProgressElement': "Element.isTagSupported('progress')", | 85 'HTMLProgressElement': "Element.isTagSupported('progress')", |
86 'HTMLShadowElement': "Element.isTagSupported('shadow')", | 86 'HTMLShadowElement': "Element.isTagSupported('shadow')", |
87 'HTMLTrackElement': "Element.isTagSupported('track')", | 87 'HTMLTrackElement': "Element.isTagSupported('track')", |
| 88 'WebSocket': "JS('bool', 'typeof window.WebSocket != \"undefined\"')", |
88 } | 89 } |
89 | 90 |
90 # Classes that offer only static methods, and therefore we should suppress | 91 # Classes that offer only static methods, and therefore we should suppress |
91 # constructor creation. | 92 # constructor creation. |
92 _static_classes = set(['Url']) | 93 _static_classes = set(['Url']) |
93 | 94 |
94 # Information for generating element constructors. | 95 # Information for generating element constructors. |
95 # | 96 # |
96 # TODO(sra): maybe remove all the argument complexity and use cascades. | 97 # TODO(sra): maybe remove all the argument complexity and use cascades. |
97 # | 98 # |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 for library_name in libraries: | 1046 for library_name in libraries: |
1046 self._libraries[library_name] = DartLibrary( | 1047 self._libraries[library_name] = DartLibrary( |
1047 library_name, template_loader, library_type, output_dir) | 1048 library_name, template_loader, library_type, output_dir) |
1048 | 1049 |
1049 def AddFile(self, basename, library_name, path): | 1050 def AddFile(self, basename, library_name, path): |
1050 self._libraries[library_name].AddFile(path) | 1051 self._libraries[library_name].AddFile(path) |
1051 | 1052 |
1052 def Emit(self, emitter, auxiliary_dir): | 1053 def Emit(self, emitter, auxiliary_dir): |
1053 for lib in self._libraries.values(): | 1054 for lib in self._libraries.values(): |
1054 lib.Emit(emitter, auxiliary_dir) | 1055 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |