| 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 'DOMWindow.indexedDB': _indexed_db_annotations, | 664 'DOMWindow.indexedDB': _indexed_db_annotations, |
| 659 'DOMWindow.performance': _performance_annotations, | 665 'DOMWindow.performance': _performance_annotations, |
| 666 'DOMWindow.webkitNotifications': _webkit_experimental_annotations, |
| 660 'DOMWindow.webkitRequestFileSystem': _file_system_annotations, | 667 'DOMWindow.webkitRequestFileSystem': _file_system_annotations, |
| 661 'DOMWindow.webkitResolveLocalFileSystemURL': _file_system_annotations, | 668 'DOMWindow.webkitResolveLocalFileSystemURL': _file_system_annotations, |
| 662 'Element.webkitCreateShadowRoot': [ | 669 'Element.webkitCreateShadowRoot': [ |
| 663 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 670 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 664 "@Experimental()", | 671 "@Experimental()", |
| 665 ], | 672 ], |
| 666 'FileSystem': _file_system_annotations, | 673 'FileSystem': _file_system_annotations, |
| 667 'FileSystemSync': _file_system_annotations, | 674 'FileSystemSync': _file_system_annotations, |
| 668 'History.pushState': _history_annotations, | 675 'History.pushState': _history_annotations, |
| 669 'History.replaceState': _history_annotations, | 676 'History.replaceState': _history_annotations, |
| 670 'HTMLContentElement': [ | 677 'HTMLContentElement': [ |
| 671 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 678 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 672 "@Experimental()", | 679 "@Experimental()", |
| 673 ], | 680 ], |
| 674 'HTMLDataListElement': _all_but_ie9_annotations, | 681 'HTMLDataListElement': _all_but_ie9_annotations, |
| 675 'HTMLDetailsElement': [ | 682 'HTMLDetailsElement': _webkit_experimental_annotations, |
| 676 "@SupportedBrowser(SupportedBrowser.CHROME)", | |
| 677 "@SupportedBrowser(SupportedBrowser.SAFARI)", | |
| 678 "@Experimental()", | |
| 679 ], | |
| 680 'HTMLEmbedElement': [ | 683 'HTMLEmbedElement': [ |
| 681 "@SupportedBrowser(SupportedBrowser.CHROME)", | 684 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 682 "@SupportedBrowser(SupportedBrowser.IE)", | 685 "@SupportedBrowser(SupportedBrowser.IE)", |
| 683 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 686 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 684 ], | 687 ], |
| 685 'HTMLKeygenElement': [ | 688 'HTMLKeygenElement': _webkit_experimental_annotations, |
| 686 "@SupportedBrowser(SupportedBrowser.CHROME)", | |
| 687 "@SupportedBrowser(SupportedBrowser.SAFARI)", | |
| 688 "@Experimental()", | |
| 689 ], | |
| 690 'HTMLMeterElement': [ | 689 'HTMLMeterElement': [ |
| 691 "@SupportedBrowser(SupportedBrowser.CHROME)", | 690 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 692 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 691 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 693 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 692 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 694 ], | 693 ], |
| 695 'HTMLObjectElement': [ | 694 'HTMLObjectElement': [ |
| 696 "@SupportedBrowser(SupportedBrowser.CHROME)", | 695 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 697 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 696 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 698 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 697 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 699 ], | 698 ], |
| 700 'HTMLOutputElement': [ | 699 'HTMLOutputElement': [ |
| 701 "@SupportedBrowser(SupportedBrowser.CHROME)", | 700 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 702 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 701 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 703 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 702 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 704 ], | 703 ], |
| 705 'HTMLProgressElement': _all_but_ie9_annotations, | 704 'HTMLProgressElement': _all_but_ie9_annotations, |
| 706 'HTMLShadowElement': [ | 705 'HTMLShadowElement': [ |
| 707 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 706 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 708 "@Experimental()", | 707 "@Experimental()", |
| 709 ], | 708 ], |
| 710 'HTMLTrackElement': [ | 709 'HTMLTrackElement': [ |
| 711 "@SupportedBrowser(SupportedBrowser.CHROME)", | 710 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 712 "@SupportedBrowser(SupportedBrowser.IE, '10')", | 711 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 713 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 712 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 714 ], | 713 ], |
| 715 'IDBFactory': _indexed_db_annotations, | 714 'IDBFactory': _indexed_db_annotations, |
| 716 'IDBDatabase': _indexed_db_annotations, | 715 'IDBDatabase': _indexed_db_annotations, |
| 716 'NotificationCenter': _webkit_experimental_annotations, |
| 717 'Performance': _performance_annotations, | 717 'Performance': _performance_annotations, |
| 718 'ShadowRoot': [ | 718 'ShadowRoot': [ |
| 719 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 719 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 720 "@Experimental()", | 720 "@Experimental()", |
| 721 ], | 721 ], |
| 722 'WebSocket': _all_but_ie9_annotations, | 722 'WebSocket': _all_but_ie9_annotations, |
| 723 'WorkerContext.indexedDB': _indexed_db_annotations, | 723 'WorkerContext.indexedDB': _indexed_db_annotations, |
| 724 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, | 724 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, |
| 725 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, | 725 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, |
| 726 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, | 726 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 self) | 1297 self) |
| 1298 | 1298 |
| 1299 if type_data.clazz == 'SVGTearOff': | 1299 if type_data.clazz == 'SVGTearOff': |
| 1300 dart_interface_name = self._renamer.RenameInterface( | 1300 dart_interface_name = self._renamer.RenameInterface( |
| 1301 self._database.GetInterface(type_name)) | 1301 self._database.GetInterface(type_name)) |
| 1302 return SVGTearOffIDLTypeInfo( | 1302 return SVGTearOffIDLTypeInfo( |
| 1303 type_name, type_data, dart_interface_name, self) | 1303 type_name, type_data, dart_interface_name, self) |
| 1304 | 1304 |
| 1305 class_name = '%sIDLTypeInfo' % type_data.clazz | 1305 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1306 return globals()[class_name](type_name, type_data) | 1306 return globals()[class_name](type_name, type_data) |
| OLD | NEW |