| 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 "@annotation_Creates_SerializedScriptValue " | 689 "@annotation_Creates_SerializedScriptValue " |
| 690 "@annotation_Returns_SerializedScriptValue", | 690 "@annotation_Returns_SerializedScriptValue", |
| 691 | 691 |
| 692 'SQLResultSetRowList.item': "@Creates('=Object')", | 692 'SQLResultSetRowList.item': "@Creates('=Object')", |
| 693 | 693 |
| 694 'XMLHttpRequest.response': | 694 'XMLHttpRequest.response': |
| 695 "@Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')", | 695 "@Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')", |
| 696 } | 696 } |
| 697 | 697 |
| 698 _indexed_db_annotations = [ | 698 _indexed_db_annotations = [ |
| 699 "@SupportedBrowser(SupportedBrowser.CHROME, '23.0')", | 699 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 700 "@SupportedBrowser(SupportedBrowser.FIREFOX, '15.0')", | 700 "@SupportedBrowser(SupportedBrowser.FIREFOX, '15')", |
| 701 "@SupportedBrowser(SupportedBrowser.IE, '10.0')", | 701 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 702 "@Experimental()", | 702 "@Experimental()", |
| 703 ] | 703 ] |
| 704 | 704 |
| 705 # Annotations to be placed on generated members. | 705 # Annotations to be placed on generated members. |
| 706 # The table is indexed as: | 706 # The table is indexed as: |
| 707 # INTERFACE: annotations to be added to the interface declaration | 707 # INTERFACE: annotations to be added to the interface declaration |
| 708 # INTERFACE.MEMBER: annotation to be added to the member declaration | 708 # INTERFACE.MEMBER: annotation to be added to the member declaration |
| 709 dart_annotations = { | 709 dart_annotations = { |
| 710 'DOMWindow.indexedDB': _indexed_db_annotations, | 710 'DOMWindow.indexedDB': _indexed_db_annotations, |
| 711 'HTMLContentElement': [ |
| 712 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 713 "@Experimental()", |
| 714 ], |
| 715 'HTMLDataListElement': [ |
| 716 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 717 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 718 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 719 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 720 ], |
| 721 'HTMLDetailsElement': [ |
| 722 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 723 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 724 "@Experimental()", |
| 725 ], |
| 726 'HTMLEmbedElement': [ |
| 727 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 728 "@SupportedBrowser(SupportedBrowser.IE)", |
| 729 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 730 ], |
| 731 'HTMLKeygenElement': [ |
| 732 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 733 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 734 "@Experimental()", |
| 735 ], |
| 736 'HTMLMeterElement': [ |
| 737 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 738 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 739 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 740 ], |
| 741 'HTMLObjectElement': [ |
| 742 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 743 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 744 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 745 ], |
| 746 'HTMLOutputElement': [ |
| 747 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 748 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 749 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 750 ], |
| 751 'HTMLProgressElement': [ |
| 752 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 753 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
| 754 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 755 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 756 ], |
| 757 'HTMLTrackElement': [ |
| 758 "@SupportedBrowser(SupportedBrowser.CHROME)", |
| 759 "@SupportedBrowser(SupportedBrowser.IE, '10')", |
| 760 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
| 761 ], |
| 711 'IDBFactory': _indexed_db_annotations, | 762 'IDBFactory': _indexed_db_annotations, |
| 712 'IDBDatabase': _indexed_db_annotations, | 763 'IDBDatabase': _indexed_db_annotations, |
| 713 'WorkerContext.indexedDB': _indexed_db_annotations, | 764 'WorkerContext.indexedDB': _indexed_db_annotations, |
| 714 } | 765 } |
| 715 | 766 |
| 716 def FindCommonAnnotations(interface_name, member_name=None): | 767 def FindCommonAnnotations(interface_name, member_name=None): |
| 717 """ Finds annotations common between dart2js and dartium. | 768 """ Finds annotations common between dart2js and dartium. |
| 718 """ | 769 """ |
| 719 if member_name: | 770 if member_name: |
| 720 return dart_annotations.get('%s.%s' % (interface_name, member_name)) | 771 return dart_annotations.get('%s.%s' % (interface_name, member_name)) |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 self) | 1339 self) |
| 1289 | 1340 |
| 1290 if type_data.clazz == 'SVGTearOff': | 1341 if type_data.clazz == 'SVGTearOff': |
| 1291 dart_interface_name = self._renamer.RenameInterface( | 1342 dart_interface_name = self._renamer.RenameInterface( |
| 1292 self._database.GetInterface(type_name)) | 1343 self._database.GetInterface(type_name)) |
| 1293 return SVGTearOffIDLTypeInfo( | 1344 return SVGTearOffIDLTypeInfo( |
| 1294 type_name, type_data, dart_interface_name, self) | 1345 type_name, type_data, dart_interface_name, self) |
| 1295 | 1346 |
| 1296 class_name = '%sIDLTypeInfo' % type_data.clazz | 1347 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1297 return globals()[class_name](type_name, type_data) | 1348 return globals()[class_name](type_name, type_data) |
| OLD | NEW |