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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 'HTMLShadowElement': "Element.isTagSupported('shadow')", | 89 'HTMLShadowElement': "Element.isTagSupported('shadow')", |
90 'HTMLTrackElement': "Element.isTagSupported('track')", | 90 'HTMLTrackElement': "Element.isTagSupported('track')", |
91 'MediaStreamEvent': "Event._isTypeSupported('MediaStreamEvent')", | 91 'MediaStreamEvent': "Event._isTypeSupported('MediaStreamEvent')", |
92 'MediaStreamTrackEvent': "Event._isTypeSupported('MediaStreamTrackEvent')", | 92 'MediaStreamTrackEvent': "Event._isTypeSupported('MediaStreamTrackEvent')", |
93 'NotificationCenter': "JS('bool', '!!(window.webkitNotifications)')", | 93 'NotificationCenter': "JS('bool', '!!(window.webkitNotifications)')", |
94 'Performance': "JS('bool', '!!(window.performance)')", | 94 'Performance': "JS('bool', '!!(window.performance)')", |
95 'SpeechRecognition': "JS('bool', '!!(window.SpeechRecognition || " | 95 'SpeechRecognition': "JS('bool', '!!(window.SpeechRecognition || " |
96 "window.webkitSpeechRecognition)')", | 96 "window.webkitSpeechRecognition)')", |
97 'XMLHttpRequestProgressEvent': | 97 'XMLHttpRequestProgressEvent': |
98 "Event._isTypeSupported('XMLHttpRequestProgressEvent')", | 98 "Event._isTypeSupported('XMLHttpRequestProgressEvent')", |
| 99 'XSLTProcessor': "JS('bool', '!!(window.XSLTProcessor)')", |
99 'WebSocket': "JS('bool', 'typeof window.WebSocket != \"undefined\"')", | 100 'WebSocket': "JS('bool', 'typeof window.WebSocket != \"undefined\"')", |
100 } | 101 } |
101 | 102 |
102 # Classes that offer only static methods, and therefore we should suppress | 103 # Classes that offer only static methods, and therefore we should suppress |
103 # constructor creation. | 104 # constructor creation. |
104 _static_classes = set(['Url']) | 105 _static_classes = set(['Url']) |
105 | 106 |
106 # Information for generating element constructors. | 107 # Information for generating element constructors. |
107 # | 108 # |
108 # TODO(sra): maybe remove all the argument complexity and use cascades. | 109 # TODO(sra): maybe remove all the argument complexity and use cascades. |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 for library_name in libraries: | 1039 for library_name in libraries: |
1039 self._libraries[library_name] = DartLibrary( | 1040 self._libraries[library_name] = DartLibrary( |
1040 library_name, template_loader, library_type, output_dir) | 1041 library_name, template_loader, library_type, output_dir) |
1041 | 1042 |
1042 def AddFile(self, basename, library_name, path): | 1043 def AddFile(self, basename, library_name, path): |
1043 self._libraries[library_name].AddFile(path) | 1044 self._libraries[library_name].AddFile(path) |
1044 | 1045 |
1045 def Emit(self, emitter, auxiliary_dir): | 1046 def Emit(self, emitter, auxiliary_dir): |
1046 for lib in self._libraries.values(): | 1047 for lib in self._libraries.values(): |
1047 lib.Emit(emitter, auxiliary_dir) | 1048 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |