| 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 "@SupportedBrowser(SupportedBrowser.CHROME)", | 685 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 686 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 686 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 687 "@SupportedBrowser(SupportedBrowser.IE)", | 687 "@SupportedBrowser(SupportedBrowser.IE)", |
| 688 ] | 688 ] |
| 689 | 689 |
| 690 _rtc_annotations = [ # Note: Firefox nightly builds also support this. | 690 _rtc_annotations = [ # Note: Firefox nightly builds also support this. |
| 691 "@SupportedBrowser(SupportedBrowser.CHROME)", | 691 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 692 "@Experimental", | 692 "@Experimental", |
| 693 ] | 693 ] |
| 694 | 694 |
| 695 _shadow_dom_annotations = [ |
| 696 "@SupportedBrowser(SupportedBrowser.CHROME, '26')", |
| 697 "@Experimental", |
| 698 ] |
| 699 |
| 695 _speech_recognition_annotations = [ | 700 _speech_recognition_annotations = [ |
| 696 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 701 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 697 "@Experimental", | 702 "@Experimental", |
| 698 ] | 703 ] |
| 699 | 704 |
| 700 _svg_annotations = _all_but_ie9_annotations; | 705 _svg_annotations = _all_but_ie9_annotations; |
| 701 | 706 |
| 702 _web_sql_annotations = [ | 707 _web_sql_annotations = [ |
| 703 "@SupportedBrowser(SupportedBrowser.CHROME)", | 708 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 704 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 709 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| (...skipping 12 matching lines...) Expand all Loading... |
| 717 "@Experimental", | 722 "@Experimental", |
| 718 ] | 723 ] |
| 719 | 724 |
| 720 # Annotations to be placed on generated members. | 725 # Annotations to be placed on generated members. |
| 721 # The table is indexed as: | 726 # The table is indexed as: |
| 722 # INTERFACE: annotations to be added to the interface declaration | 727 # INTERFACE: annotations to be added to the interface declaration |
| 723 # INTERFACE.MEMBER: annotation to be added to the member declaration | 728 # INTERFACE.MEMBER: annotation to be added to the member declaration |
| 724 dart_annotations = monitored.Dict('generator.dart_annotations', { | 729 dart_annotations = monitored.Dict('generator.dart_annotations', { |
| 725 'ArrayBuffer': _all_but_ie9_annotations, | 730 'ArrayBuffer': _all_but_ie9_annotations, |
| 726 'ArrayBufferView': _all_but_ie9_annotations, | 731 'ArrayBufferView': _all_but_ie9_annotations, |
| 732 'CSSHostRule': _shadow_dom_annotations, |
| 727 'Crypto': _webkit_experimental_annotations, | 733 'Crypto': _webkit_experimental_annotations, |
| 728 'Database': _web_sql_annotations, | 734 'Database': _web_sql_annotations, |
| 729 'DatabaseSync': _web_sql_annotations, | 735 'DatabaseSync': _web_sql_annotations, |
| 730 'DOMApplicationCache': [ | 736 'DOMApplicationCache': [ |
| 731 "@SupportedBrowser(SupportedBrowser.CHROME)", | 737 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 732 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 738 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 733 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 739 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 734 "@SupportedBrowser(SupportedBrowser.OPERA)", | 740 "@SupportedBrowser(SupportedBrowser.OPERA)", |
| 735 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 741 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 736 ], | 742 ], |
| (...skipping 16 matching lines...) Expand all Loading... |
| 753 "@Experimental", | 759 "@Experimental", |
| 754 ], | 760 ], |
| 755 'FormData': _all_but_ie9_annotations, | 761 'FormData': _all_but_ie9_annotations, |
| 756 'HashChangeEvent': [ | 762 'HashChangeEvent': [ |
| 757 "@SupportedBrowser(SupportedBrowser.CHROME)", | 763 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 758 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 764 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 759 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 765 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 760 ], | 766 ], |
| 761 'History.pushState': _history_annotations, | 767 'History.pushState': _history_annotations, |
| 762 'History.replaceState': _history_annotations, | 768 'History.replaceState': _history_annotations, |
| 763 'HTMLContentElement': [ | 769 'HTMLContentElement': _shadow_dom_annotations, |
| 764 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | |
| 765 "@Experimental", | |
| 766 ], | |
| 767 'HTMLDataListElement': _all_but_ie9_annotations, | 770 'HTMLDataListElement': _all_but_ie9_annotations, |
| 768 'HTMLDetailsElement': _webkit_experimental_annotations, | 771 'HTMLDetailsElement': _webkit_experimental_annotations, |
| 769 'HTMLEmbedElement': [ | 772 'HTMLEmbedElement': [ |
| 770 "@SupportedBrowser(SupportedBrowser.CHROME)", | 773 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 771 "@SupportedBrowser(SupportedBrowser.IE)", | 774 "@SupportedBrowser(SupportedBrowser.IE)", |
| 772 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 775 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 773 ], | 776 ], |
| 774 'HTMLKeygenElement': _webkit_experimental_annotations, | 777 'HTMLKeygenElement': _webkit_experimental_annotations, |
| 775 'HTMLMeterElement': _no_ie_annotations, | 778 'HTMLMeterElement': _no_ie_annotations, |
| 776 'HTMLObjectElement': [ | 779 'HTMLObjectElement': [ |
| 777 "@SupportedBrowser(SupportedBrowser.CHROME)", | 780 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 778 "@SupportedBrowser(SupportedBrowser.IE)", | 781 "@SupportedBrowser(SupportedBrowser.IE)", |
| 779 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 782 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 780 ], | 783 ], |
| 781 'HTMLOutputElement': _no_ie_annotations, | 784 'HTMLOutputElement': _no_ie_annotations, |
| 782 'HTMLProgressElement': _all_but_ie9_annotations, | 785 'HTMLProgressElement': _all_but_ie9_annotations, |
| 783 'HTMLShadowElement': [ | 786 'HTMLShadowElement': _shadow_dom_annotations, |
| 784 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | |
| 785 "@Experimental", | |
| 786 ], | |
| 787 'HTMLTrackElement': [ | 787 'HTMLTrackElement': [ |
| 788 "@SupportedBrowser(SupportedBrowser.CHROME)", | 788 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 789 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 789 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 790 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 790 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 791 ], | 791 ], |
| 792 'IDBFactory': _indexed_db_annotations, | 792 'IDBFactory': _indexed_db_annotations, |
| 793 'IDBDatabase': _indexed_db_annotations, | 793 'IDBDatabase': _indexed_db_annotations, |
| 794 'LocalMediaStream': _rtc_annotations, | 794 'LocalMediaStream': _rtc_annotations, |
| 795 'MediaStream': _rtc_annotations, | 795 'MediaStream': _rtc_annotations, |
| 796 'MediaStreamEvent': _rtc_annotations, | 796 'MediaStreamEvent': _rtc_annotations, |
| 797 'MediaStreamTrack': _rtc_annotations, | 797 'MediaStreamTrack': _rtc_annotations, |
| 798 'MediaStreamTrackEvent': _rtc_annotations, | 798 'MediaStreamTrackEvent': _rtc_annotations, |
| 799 'MutationObserver': [ | 799 'MutationObserver': [ |
| 800 "@SupportedBrowser(SupportedBrowser.CHROME)", | 800 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 801 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 801 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 802 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 802 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 803 "@Experimental", | 803 "@Experimental", |
| 804 ], | 804 ], |
| 805 'NotificationCenter': _webkit_experimental_annotations, | 805 'NotificationCenter': _webkit_experimental_annotations, |
| 806 'Performance': _performance_annotations, | 806 'Performance': _performance_annotations, |
| 807 'PopStateEvent': _history_annotations, | 807 'PopStateEvent': _history_annotations, |
| 808 'RTCIceCandidate': _rtc_annotations, | 808 'RTCIceCandidate': _rtc_annotations, |
| 809 'RTCPeerConnection': _rtc_annotations, | 809 'RTCPeerConnection': _rtc_annotations, |
| 810 'RTCSessionDescription': _rtc_annotations, | 810 'RTCSessionDescription': _rtc_annotations, |
| 811 'ShadowRoot': [ | 811 'ShadowRoot': _shadow_dom_annotations, |
| 812 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | |
| 813 "@Experimental", | |
| 814 ], | |
| 815 'SpeechRecognition': _speech_recognition_annotations, | 812 'SpeechRecognition': _speech_recognition_annotations, |
| 816 'SpeechRecognitionAlternative': _speech_recognition_annotations, | 813 'SpeechRecognitionAlternative': _speech_recognition_annotations, |
| 817 'SpeechRecognitionError': _speech_recognition_annotations, | 814 'SpeechRecognitionError': _speech_recognition_annotations, |
| 818 'SpeechRecognitionEvent': _speech_recognition_annotations, | 815 'SpeechRecognitionEvent': _speech_recognition_annotations, |
| 819 'SpeechRecognitionResult': _speech_recognition_annotations, | 816 'SpeechRecognitionResult': _speech_recognition_annotations, |
| 820 'SVGAltGlyphElement': _no_ie_annotations, | 817 'SVGAltGlyphElement': _no_ie_annotations, |
| 821 'SVGAnimateElement': _no_ie_annotations, | 818 'SVGAnimateElement': _no_ie_annotations, |
| 822 'SVGAnimateMotionElement': _no_ie_annotations, | 819 'SVGAnimateMotionElement': _no_ie_annotations, |
| 823 'SVGAnimateTransformElement': _no_ie_annotations, | 820 'SVGAnimateTransformElement': _no_ie_annotations, |
| 824 'SVGFEBlendElement': _svg_annotations, | 821 'SVGFEBlendElement': _svg_annotations, |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 self) | 1498 self) |
| 1502 | 1499 |
| 1503 if type_data.clazz == 'SVGTearOff': | 1500 if type_data.clazz == 'SVGTearOff': |
| 1504 dart_interface_name = self._renamer.RenameInterface( | 1501 dart_interface_name = self._renamer.RenameInterface( |
| 1505 self._database.GetInterface(type_name)) | 1502 self._database.GetInterface(type_name)) |
| 1506 return SVGTearOffIDLTypeInfo( | 1503 return SVGTearOffIDLTypeInfo( |
| 1507 type_name, type_data, dart_interface_name, self) | 1504 type_name, type_data, dart_interface_name, self) |
| 1508 | 1505 |
| 1509 class_name = '%sIDLTypeInfo' % type_data.clazz | 1506 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1510 return globals()[class_name](type_name, type_data) | 1507 return globals()[class_name](type_name, type_data) |
| OLD | NEW |