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 to provide Dart metadata for | 6 """This module provides shared functionality to provide Dart metadata for |
7 DOM APIs. | 7 DOM APIs. |
8 """ | 8 """ |
9 | 9 |
10 import copy | 10 import copy |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 420 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
421 "@Experimental()", | 421 "@Experimental()", |
422 ] | 422 ] |
423 | 423 |
424 _webgl_annotations = [ | 424 _webgl_annotations = [ |
425 "@SupportedBrowser(SupportedBrowser.CHROME)", | 425 "@SupportedBrowser(SupportedBrowser.CHROME)", |
426 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 426 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
427 "@Experimental()", | 427 "@Experimental()", |
428 ] | 428 ] |
429 | 429 |
| 430 _web_audio_annotations = _webgl_annotations |
| 431 |
430 _webkit_experimental_annotations = [ | 432 _webkit_experimental_annotations = [ |
431 "@SupportedBrowser(SupportedBrowser.CHROME)", | 433 "@SupportedBrowser(SupportedBrowser.CHROME)", |
432 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 434 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
433 "@Experimental()", | 435 "@Experimental()", |
434 ] | 436 ] |
435 | 437 |
436 # Annotations to be placed on generated members. | 438 # Annotations to be placed on generated members. |
437 # The table is indexed as: | 439 # The table is indexed as: |
438 # INTERFACE: annotations to be added to the interface declaration | 440 # INTERFACE: annotations to be added to the interface declaration |
439 # INTERFACE.MEMBER: annotation to be added to the member declaration | 441 # INTERFACE.MEMBER: annotation to be added to the member declaration |
440 _annotations = monitored.Dict('dartmetadata._annotations', { | 442 _annotations = monitored.Dict('dartmetadata._annotations', { |
441 'CSSHostRule': _shadow_dom_annotations, | 443 'CSSHostRule': _shadow_dom_annotations, |
442 'WebKitCSSMatrix': _webkit_experimental_annotations, | 444 'WebKitCSSMatrix': _webkit_experimental_annotations, |
443 'Crypto': _webkit_experimental_annotations, | 445 'Crypto': _webkit_experimental_annotations, |
444 'Database': _web_sql_annotations, | 446 'Database': _web_sql_annotations, |
445 'DatabaseSync': _web_sql_annotations, | 447 'DatabaseSync': _web_sql_annotations, |
446 'ApplicationCache': [ | 448 'ApplicationCache': [ |
447 "@SupportedBrowser(SupportedBrowser.CHROME)", | 449 "@SupportedBrowser(SupportedBrowser.CHROME)", |
448 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 450 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
449 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 451 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
450 "@SupportedBrowser(SupportedBrowser.OPERA)", | 452 "@SupportedBrowser(SupportedBrowser.OPERA)", |
451 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 453 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
452 ], | 454 ], |
| 455 'AudioBufferSourceNode': _web_audio_annotations, |
| 456 'AudioContext': _web_audio_annotations, |
453 'DOMFileSystem': _file_system_annotations, | 457 'DOMFileSystem': _file_system_annotations, |
454 'DOMFileSystemSync': _file_system_annotations, | 458 'DOMFileSystemSync': _file_system_annotations, |
455 'WebKitPoint': _webkit_experimental_annotations, | 459 'WebKitPoint': _webkit_experimental_annotations, |
456 'Window.webkitConvertPointFromNodeToPage': _webkit_experimental_annotations, | 460 'Window.webkitConvertPointFromNodeToPage': _webkit_experimental_annotations, |
457 'Window.webkitConvertPointFromPageToNode': _webkit_experimental_annotations, | 461 'Window.webkitConvertPointFromPageToNode': _webkit_experimental_annotations, |
458 'Window.indexedDB': _indexed_db_annotations, | 462 'Window.indexedDB': _indexed_db_annotations, |
459 'Window.openDatabase': _web_sql_annotations, | 463 'Window.openDatabase': _web_sql_annotations, |
460 'Window.performance': _performance_annotations, | 464 'Window.performance': _performance_annotations, |
461 'Window.webkitNotifications': _webkit_experimental_annotations, | 465 'Window.webkitNotifications': _webkit_experimental_annotations, |
462 'Window.webkitRequestFileSystem': _file_system_annotations, | 466 'Window.webkitRequestFileSystem': _file_system_annotations, |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 pass | 823 pass |
820 else: | 824 else: |
821 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) | 825 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) |
822 | 826 |
823 return annotations | 827 return annotations |
824 | 828 |
825 def Flush(self): | 829 def Flush(self): |
826 json_file = open(self._api_status_path, 'w+') | 830 json_file = open(self._api_status_path, 'w+') |
827 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) | 831 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) |
828 json_file.close() | 832 json_file.close() |
OLD | NEW |