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 systems to generate | 6 """This module provides shared functionality for systems to generate |
7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
8 | 8 |
9 import copy | 9 import copy |
10 import json | 10 import json |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 "@Experimental", | 666 "@Experimental", |
667 ] | 667 ] |
668 | 668 |
669 _all_but_ie9_annotations = [ | 669 _all_but_ie9_annotations = [ |
670 "@SupportedBrowser(SupportedBrowser.CHROME)", | 670 "@SupportedBrowser(SupportedBrowser.CHROME)", |
671 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 671 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
672 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 672 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
673 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 673 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
674 ] | 674 ] |
675 | 675 |
676 _webkit_experimental_annotations = [ | |
677 "@SupportedBrowser(SupportedBrowser.CHROME)", | |
678 "@SupportedBrowser(SupportedBrowser.SAFARI)", | |
679 "@Experimental", | |
680 ] | |
681 | |
682 _history_annotations = _all_but_ie9_annotations | 676 _history_annotations = _all_but_ie9_annotations |
683 | 677 |
684 _no_ie_annotations = [ | 678 _no_ie_annotations = [ |
685 "@SupportedBrowser(SupportedBrowser.CHROME)", | 679 "@SupportedBrowser(SupportedBrowser.CHROME)", |
686 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 680 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
687 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 681 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
688 ] | 682 ] |
689 | 683 |
690 _performance_annotations = [ | 684 _performance_annotations = [ |
691 "@SupportedBrowser(SupportedBrowser.CHROME)", | 685 "@SupportedBrowser(SupportedBrowser.CHROME)", |
692 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 686 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
693 "@SupportedBrowser(SupportedBrowser.IE)", | 687 "@SupportedBrowser(SupportedBrowser.IE)", |
694 ] | 688 ] |
695 | 689 |
| 690 _rtc_annotations = [ # Note: Firefox nightly builds also support this. |
| 691 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 692 "@Experimental", |
| 693 ] |
| 694 |
696 _speech_recognition_annotations = [ | 695 _speech_recognition_annotations = [ |
697 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 696 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
698 "@Experimental", | 697 "@Experimental", |
699 ] | 698 ] |
700 | 699 |
701 _svg_annotations = _all_but_ie9_annotations; | 700 _svg_annotations = _all_but_ie9_annotations; |
702 | 701 |
703 _web_sql_annotations = [ | 702 _web_sql_annotations = [ |
704 "@SupportedBrowser(SupportedBrowser.CHROME)", | 703 "@SupportedBrowser(SupportedBrowser.CHROME)", |
705 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 704 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
706 "@Experimental", | 705 "@Experimental", |
707 ] | 706 ] |
708 | 707 |
709 _webgl_annotations = [ | 708 _webgl_annotations = [ |
710 "@SupportedBrowser(SupportedBrowser.CHROME)", | 709 "@SupportedBrowser(SupportedBrowser.CHROME)", |
711 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 710 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
712 "@Experimental", | 711 "@Experimental", |
713 ] | 712 ] |
714 | 713 |
| 714 _webkit_experimental_annotations = [ |
| 715 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 716 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 717 "@Experimental", |
| 718 ] |
| 719 |
715 # Annotations to be placed on generated members. | 720 # Annotations to be placed on generated members. |
716 # The table is indexed as: | 721 # The table is indexed as: |
717 # INTERFACE: annotations to be added to the interface declaration | 722 # INTERFACE: annotations to be added to the interface declaration |
718 # INTERFACE.MEMBER: annotation to be added to the member declaration | 723 # INTERFACE.MEMBER: annotation to be added to the member declaration |
719 dart_annotations = { | 724 dart_annotations = { |
720 'ArrayBuffer': _all_but_ie9_annotations, | 725 'ArrayBuffer': _all_but_ie9_annotations, |
721 'ArrayBufferView': _all_but_ie9_annotations, | 726 'ArrayBufferView': _all_but_ie9_annotations, |
722 'Database': _web_sql_annotations, | 727 'Database': _web_sql_annotations, |
723 'DatabaseSync': _web_sql_annotations, | 728 'DatabaseSync': _web_sql_annotations, |
724 'DOMApplicationCache': [ | 729 'DOMApplicationCache': [ |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 782 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
778 "@Experimental", | 783 "@Experimental", |
779 ], | 784 ], |
780 'HTMLTrackElement': [ | 785 'HTMLTrackElement': [ |
781 "@SupportedBrowser(SupportedBrowser.CHROME)", | 786 "@SupportedBrowser(SupportedBrowser.CHROME)", |
782 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 787 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
783 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 788 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
784 ], | 789 ], |
785 'IDBFactory': _indexed_db_annotations, | 790 'IDBFactory': _indexed_db_annotations, |
786 'IDBDatabase': _indexed_db_annotations, | 791 'IDBDatabase': _indexed_db_annotations, |
| 792 'LocalMediaStream': _rtc_annotations, |
| 793 'MediaStream': _rtc_annotations, |
| 794 'MediaStreamEvents': _rtc_annotations, |
| 795 'MediaStreamEvent': _rtc_annotations, |
| 796 'MediaStreamTrack': _rtc_annotations, |
| 797 'MediaStreamTrackEvent': _rtc_annotations, |
| 798 'MediaStreamTrackEvents': _rtc_annotations, |
787 'MutationObserver': [ | 799 'MutationObserver': [ |
788 "@SupportedBrowser(SupportedBrowser.CHROME)", | 800 "@SupportedBrowser(SupportedBrowser.CHROME)", |
789 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 801 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
790 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 802 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
791 "@Experimental", | 803 "@Experimental", |
792 ], | 804 ], |
793 'NotificationCenter': _webkit_experimental_annotations, | 805 'NotificationCenter': _webkit_experimental_annotations, |
794 'Performance': _performance_annotations, | 806 'Performance': _performance_annotations, |
795 'PopStateEvent': _history_annotations, | 807 'PopStateEvent': _history_annotations, |
| 808 'RTCIceCandidate': _rtc_annotations, |
| 809 'RTCPeerConnection': _rtc_annotations, |
| 810 'RTCSessionDescription': _rtc_annotations, |
796 'ShadowRoot': [ | 811 'ShadowRoot': [ |
797 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 812 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
798 "@Experimental", | 813 "@Experimental", |
799 ], | 814 ], |
800 'SpeechRecognition': _speech_recognition_annotations, | 815 'SpeechRecognition': _speech_recognition_annotations, |
801 'SpeechRecognitionAlternative': _speech_recognition_annotations, | 816 'SpeechRecognitionAlternative': _speech_recognition_annotations, |
802 'SpeechRecognitionError': _speech_recognition_annotations, | 817 'SpeechRecognitionError': _speech_recognition_annotations, |
803 'SpeechRecognitionEvent': _speech_recognition_annotations, | 818 'SpeechRecognitionEvent': _speech_recognition_annotations, |
804 'SpeechRecognitionResult': _speech_recognition_annotations, | 819 'SpeechRecognitionResult': _speech_recognition_annotations, |
805 'SVGAltGlyphElement': _no_ie_annotations, | 820 'SVGAltGlyphElement': _no_ie_annotations, |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 self) | 1495 self) |
1481 | 1496 |
1482 if type_data.clazz == 'SVGTearOff': | 1497 if type_data.clazz == 'SVGTearOff': |
1483 dart_interface_name = self._renamer.RenameInterface( | 1498 dart_interface_name = self._renamer.RenameInterface( |
1484 self._database.GetInterface(type_name)) | 1499 self._database.GetInterface(type_name)) |
1485 return SVGTearOffIDLTypeInfo( | 1500 return SVGTearOffIDLTypeInfo( |
1486 type_name, type_data, dart_interface_name, self) | 1501 type_name, type_data, dart_interface_name, self) |
1487 | 1502 |
1488 class_name = '%sIDLTypeInfo' % type_data.clazz | 1503 class_name = '%sIDLTypeInfo' % type_data.clazz |
1489 return globals()[class_name](type_name, type_data) | 1504 return globals()[class_name](type_name, type_data) |
OLD | NEW |