| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 ] | 358 ] |
| 359 | 359 |
| 360 js_support_checks = dict({ | 360 js_support_checks = dict({ |
| 361 'ArrayBuffer': "JS('bool', 'typeof window.ArrayBuffer != \"undefined\"')", | 361 'ArrayBuffer': "JS('bool', 'typeof window.ArrayBuffer != \"undefined\"')", |
| 362 'Crypto': | 362 'Crypto': |
| 363 "JS('bool', '!!(window.crypto && window.crypto.getRandomValues)')", | 363 "JS('bool', '!!(window.crypto && window.crypto.getRandomValues)')", |
| 364 'Database': "JS('bool', '!!(window.openDatabase)')", | 364 'Database': "JS('bool', '!!(window.openDatabase)')", |
| 365 'DOMApplicationCache': "JS('bool', '!!(window.applicationCache)')", | 365 'DOMApplicationCache': "JS('bool', '!!(window.applicationCache)')", |
| 366 'DOMFileSystem': "JS('bool', '!!(window.webkitRequestFileSystem)')", | 366 'DOMFileSystem': "JS('bool', '!!(window.webkitRequestFileSystem)')", |
| 367 'FormData': "JS('bool', '!!(window.FormData)')", | 367 'FormData': "JS('bool', '!!(window.FormData)')", |
| 368 'HashChangeEvent': "Event._isTypeSupported('HashChangeEvent')", | 368 'HashChangeEvent': "Device.isEventTypeSupported('HashChangeEvent')", |
| 369 'HTMLShadowElement': ElemSupportStr('shadow'), | 369 'HTMLShadowElement': ElemSupportStr('shadow'), |
| 370 'MediaStreamEvent': "Event._isTypeSupported('MediaStreamEvent')", | 370 'MediaStreamEvent': "Device.isEventTypeSupported('MediaStreamEvent')", |
| 371 'MediaStreamTrackEvent': "Event._isTypeSupported('MediaStreamTrackEvent')", | 371 'MediaStreamTrackEvent': "Device.isEventTypeSupported('MediaStreamTrackEvent
')", |
| 372 'NotificationCenter': "JS('bool', '!!(window.webkitNotifications)')", | 372 'NotificationCenter': "JS('bool', '!!(window.webkitNotifications)')", |
| 373 'Performance': "JS('bool', '!!(window.performance)')", | 373 'Performance': "JS('bool', '!!(window.performance)')", |
| 374 'SpeechRecognition': "JS('bool', '!!(window.SpeechRecognition || " | 374 'SpeechRecognition': "JS('bool', '!!(window.SpeechRecognition || " |
| 375 "window.webkitSpeechRecognition)')", | 375 "window.webkitSpeechRecognition)')", |
| 376 'SVGExternalResourcesRequired': ('supported(SvgElement element)', | 376 'SVGExternalResourcesRequired': ('supported(SvgElement element)', |
| 377 "JS('bool', '#.externalResourcesRequired !== undefined && " | 377 "JS('bool', '#.externalResourcesRequired !== undefined && " |
| 378 "#.externalResourcesRequired.animVal !== undefined', " | 378 "#.externalResourcesRequired.animVal !== undefined', " |
| 379 "element, element)"), | 379 "element, element)"), |
| 380 'SVGLangSpace': ('supported(SvgElement element)', | 380 'SVGLangSpace': ('supported(SvgElement element)', |
| 381 "JS('bool', '#.xmlspace !== undefined && #.xmllang !== undefined', " | 381 "JS('bool', '#.xmlspace !== undefined && #.xmllang !== undefined', " |
| 382 "element, element)"), | 382 "element, element)"), |
| 383 'TouchList': "JS('bool', '!!document.createTouchList')", | 383 'TouchList': "JS('bool', '!!document.createTouchList')", |
| 384 'XMLHttpRequestProgressEvent': | 384 'XMLHttpRequestProgressEvent': |
| 385 "Event._isTypeSupported('XMLHttpRequestProgressEvent')", | 385 "Device.isEventTypeSupported('XMLHttpRequestProgressEvent')", |
| 386 'WebGLRenderingContext': "JS('bool', '!!(window.WebGLRenderingContext)')", | 386 'WebGLRenderingContext': "JS('bool', '!!(window.WebGLRenderingContext)')", |
| 387 'WebKitCSSMatrix': "JS('bool', '!!(window.WebKitCSSMatrix)')", | 387 'WebKitCSSMatrix': "JS('bool', '!!(window.WebKitCSSMatrix)')", |
| 388 'WebKitPoint': "JS('bool', '!!(window.WebKitPoint)')", | 388 'WebKitPoint': "JS('bool', '!!(window.WebKitPoint)')", |
| 389 'WebSocket': "JS('bool', 'typeof window.WebSocket != \"undefined\"')", | 389 'WebSocket': "JS('bool', 'typeof window.WebSocket != \"undefined\"')", |
| 390 'XSLTProcessor': "JS('bool', '!!(window.XSLTProcessor)')", | 390 'XSLTProcessor': "JS('bool', '!!(window.XSLTProcessor)')", |
| 391 }.items() + | 391 }.items() + |
| 392 dict((key, | 392 dict((key, |
| 393 SvgSupportStr(_svg_element_constructors[key]) if key.startswith('SVG') | 393 SvgSupportStr(_svg_element_constructors[key]) if key.startswith('SVG') |
| 394 else ElemSupportStr(_html_element_constructors[key])) for key in | 394 else ElemSupportStr(_html_element_constructors[key])) for key in |
| 395 _js_support_checks_basic_element_with_constructors + | 395 _js_support_checks_basic_element_with_constructors + |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 for library_name in libraries: | 1135 for library_name in libraries: |
| 1136 self._libraries[library_name] = DartLibrary( | 1136 self._libraries[library_name] = DartLibrary( |
| 1137 library_name, template_loader, library_type, output_dir) | 1137 library_name, template_loader, library_type, output_dir) |
| 1138 | 1138 |
| 1139 def AddFile(self, basename, library_name, path): | 1139 def AddFile(self, basename, library_name, path): |
| 1140 self._libraries[library_name].AddFile(path) | 1140 self._libraries[library_name].AddFile(path) |
| 1141 | 1141 |
| 1142 def Emit(self, emitter, auxiliary_dir): | 1142 def Emit(self, emitter, auxiliary_dir): |
| 1143 for lib in self._libraries.values(): | 1143 for lib in self._libraries.values(): |
| 1144 lib.Emit(emitter, auxiliary_dir) | 1144 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |