| 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 re | 10 import re |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 "@Experimental()", | 633 "@Experimental()", |
| 634 ] | 634 ] |
| 635 | 635 |
| 636 _all_but_ie9_annotations = [ | 636 _all_but_ie9_annotations = [ |
| 637 "@SupportedBrowser(SupportedBrowser.CHROME)", | 637 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 638 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 638 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 639 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 639 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 640 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 640 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 641 ] | 641 ] |
| 642 | 642 |
| 643 _webkit_experimental_annotations = [ |
| 644 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 645 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 646 "@Experimental()", |
| 647 ] |
| 648 |
| 643 _history_annotations = _all_but_ie9_annotations | 649 _history_annotations = _all_but_ie9_annotations |
| 644 | 650 |
| 645 _performance_annotations = [ | 651 _performance_annotations = [ |
| 646 "@SupportedBrowser(SupportedBrowser.CHROME)", | 652 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 647 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 653 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 648 "@SupportedBrowser(SupportedBrowser.IE)", | 654 "@SupportedBrowser(SupportedBrowser.IE)", |
| 649 ] | 655 ] |
| 650 | 656 |
| 651 # Annotations to be placed on generated members. | 657 # Annotations to be placed on generated members. |
| 652 # The table is indexed as: | 658 # The table is indexed as: |
| 653 # INTERFACE: annotations to be added to the interface declaration | 659 # INTERFACE: annotations to be added to the interface declaration |
| 654 # INTERFACE.MEMBER: annotation to be added to the member declaration | 660 # INTERFACE.MEMBER: annotation to be added to the member declaration |
| 655 dart_annotations = { | 661 dart_annotations = { |
| 656 'ArrayBuffer': _all_but_ie9_annotations, | 662 'ArrayBuffer': _all_but_ie9_annotations, |
| 657 'ArrayBufferView': _all_but_ie9_annotations, | 663 'ArrayBufferView': _all_but_ie9_annotations, |
| 658 'DOMApplicationCache': [ | 664 'DOMApplicationCache': [ |
| 659 "@SupportedBrowser(SupportedBrowser.CHROME)", | 665 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 660 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 666 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 661 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 667 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 662 "@SupportedBrowser(SupportedBrowser.OPERA)", | 668 "@SupportedBrowser(SupportedBrowser.OPERA)", |
| 663 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 669 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 664 ], | 670 ], |
| 665 'DOMWindow.indexedDB': _indexed_db_annotations, | 671 'DOMWindow.indexedDB': _indexed_db_annotations, |
| 666 'DOMWindow.performance': _performance_annotations, | 672 'DOMWindow.performance': _performance_annotations, |
| 673 'DOMWindow.webkitNotifications': _webkit_experimental_annotations, |
| 667 'DOMWindow.webkitRequestFileSystem': _file_system_annotations, | 674 'DOMWindow.webkitRequestFileSystem': _file_system_annotations, |
| 668 'DOMWindow.webkitResolveLocalFileSystemURL': _file_system_annotations, | 675 'DOMWindow.webkitResolveLocalFileSystemURL': _file_system_annotations, |
| 669 'Element.webkitCreateShadowRoot': [ | 676 'Element.webkitCreateShadowRoot': [ |
| 670 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 677 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 671 "@Experimental()", | 678 "@Experimental()", |
| 672 ], | 679 ], |
| 673 'FileSystem': _file_system_annotations, | 680 'FileSystem': _file_system_annotations, |
| 674 'FileSystemSync': _file_system_annotations, | 681 'FileSystemSync': _file_system_annotations, |
| 675 'History.pushState': _history_annotations, | 682 'History.pushState': _history_annotations, |
| 676 'History.replaceState': _history_annotations, | 683 'History.replaceState': _history_annotations, |
| 677 'HTMLContentElement': [ | 684 'HTMLContentElement': [ |
| 678 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 685 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 679 "@Experimental()", | 686 "@Experimental()", |
| 680 ], | 687 ], |
| 681 'HTMLDataListElement': _all_but_ie9_annotations, | 688 'HTMLDataListElement': _all_but_ie9_annotations, |
| 682 'HTMLDetailsElement': [ | 689 'HTMLDetailsElement': _webkit_experimental_annotations, |
| 683 "@SupportedBrowser(SupportedBrowser.CHROME)", | |
| 684 "@SupportedBrowser(SupportedBrowser.SAFARI)", | |
| 685 "@Experimental()", | |
| 686 ], | |
| 687 'HTMLEmbedElement': [ | 690 'HTMLEmbedElement': [ |
| 688 "@SupportedBrowser(SupportedBrowser.CHROME)", | 691 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 689 "@SupportedBrowser(SupportedBrowser.IE)", | 692 "@SupportedBrowser(SupportedBrowser.IE)", |
| 690 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 693 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 691 ], | 694 ], |
| 692 'HTMLKeygenElement': [ | 695 'HTMLKeygenElement': _webkit_experimental_annotations, |
| 693 "@SupportedBrowser(SupportedBrowser.CHROME)", | |
| 694 "@SupportedBrowser(SupportedBrowser.SAFARI)", | |
| 695 "@Experimental()", | |
| 696 ], | |
| 697 'HTMLMeterElement': [ | 696 'HTMLMeterElement': [ |
| 698 "@SupportedBrowser(SupportedBrowser.CHROME)", | 697 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 699 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 698 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 700 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 699 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 701 ], | 700 ], |
| 702 'HTMLObjectElement': [ | 701 'HTMLObjectElement': [ |
| 703 "@SupportedBrowser(SupportedBrowser.CHROME)", | 702 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 704 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 703 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 705 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 704 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 706 ], | 705 ], |
| 707 'HTMLOutputElement': [ | 706 'HTMLOutputElement': [ |
| 708 "@SupportedBrowser(SupportedBrowser.CHROME)", | 707 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 709 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 708 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 710 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 709 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 711 ], | 710 ], |
| 712 'HTMLProgressElement': _all_but_ie9_annotations, | 711 'HTMLProgressElement': _all_but_ie9_annotations, |
| 713 'HTMLShadowElement': [ | 712 'HTMLShadowElement': [ |
| 714 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 713 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 715 "@Experimental()", | 714 "@Experimental()", |
| 716 ], | 715 ], |
| 717 'HTMLTrackElement': [ | 716 'HTMLTrackElement': [ |
| 718 "@SupportedBrowser(SupportedBrowser.CHROME)", | 717 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 719 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 718 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 720 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 719 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 721 ], | 720 ], |
| 722 'IDBFactory': _indexed_db_annotations, | 721 'IDBFactory': _indexed_db_annotations, |
| 723 'IDBDatabase': _indexed_db_annotations, | 722 'IDBDatabase': _indexed_db_annotations, |
| 723 'NotificationCenter': _webkit_experimental_annotations, |
| 724 'Performance': _performance_annotations, | 724 'Performance': _performance_annotations, |
| 725 'ShadowRoot': [ | 725 'ShadowRoot': [ |
| 726 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 726 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 727 "@Experimental()", | 727 "@Experimental()", |
| 728 ], | 728 ], |
| 729 'WebSocket': _all_but_ie9_annotations, | 729 'WebSocket': _all_but_ie9_annotations, |
| 730 'WorkerContext.indexedDB': _indexed_db_annotations, | 730 'WorkerContext.indexedDB': _indexed_db_annotations, |
| 731 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, | 731 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, |
| 732 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, | 732 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, |
| 733 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, | 733 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 self) | 1304 self) |
| 1305 | 1305 |
| 1306 if type_data.clazz == 'SVGTearOff': | 1306 if type_data.clazz == 'SVGTearOff': |
| 1307 dart_interface_name = self._renamer.RenameInterface( | 1307 dart_interface_name = self._renamer.RenameInterface( |
| 1308 self._database.GetInterface(type_name)) | 1308 self._database.GetInterface(type_name)) |
| 1309 return SVGTearOffIDLTypeInfo( | 1309 return SVGTearOffIDLTypeInfo( |
| 1310 type_name, type_data, dart_interface_name, self) | 1310 type_name, type_data, dart_interface_name, self) |
| 1311 | 1311 |
| 1312 class_name = '%sIDLTypeInfo' % type_data.clazz | 1312 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1313 return globals()[class_name](type_name, type_data) | 1313 return globals()[class_name](type_name, type_data) |
| OLD | NEW |