Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: tools/dom/scripts/generator.py

Issue 11748003: Fixing up WebComponents types & tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 "@SupportedBrowser(SupportedBrowser.IE, '10')", 628 "@SupportedBrowser(SupportedBrowser.IE, '10')",
629 "@SupportedBrowser(SupportedBrowser.SAFARI)", 629 "@SupportedBrowser(SupportedBrowser.SAFARI)",
630 ] 630 ]
631 631
632 # Annotations to be placed on generated members. 632 # Annotations to be placed on generated members.
633 # The table is indexed as: 633 # The table is indexed as:
634 # INTERFACE: annotations to be added to the interface declaration 634 # INTERFACE: annotations to be added to the interface declaration
635 # INTERFACE.MEMBER: annotation to be added to the member declaration 635 # INTERFACE.MEMBER: annotation to be added to the member declaration
636 dart_annotations = { 636 dart_annotations = {
637 'DOMWindow.indexedDB': _indexed_db_annotations, 637 'DOMWindow.indexedDB': _indexed_db_annotations,
638 'Element.webkitCreateShadowRoot': [
639 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
Emily Fortuna 2013/01/02 18:54:04 not safari as well?
blois 2013/01/02 21:28:41 Actually only Chrome with a flag.
640 "@Experimental()",
641 ],
638 'History.pushState': _history_annotations, 642 'History.pushState': _history_annotations,
639 'History.replaceState': _history_annotations, 643 'History.replaceState': _history_annotations,
640 'HTMLContentElement': [ 644 'HTMLContentElement': [
641 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", 645 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
642 "@Experimental()", 646 "@Experimental()",
643 ], 647 ],
644 'HTMLDataListElement': [ 648 'HTMLDataListElement': [
645 "@SupportedBrowser(SupportedBrowser.CHROME)", 649 "@SupportedBrowser(SupportedBrowser.CHROME)",
646 "@SupportedBrowser(SupportedBrowser.FIREFOX)", 650 "@SupportedBrowser(SupportedBrowser.FIREFOX)",
647 "@SupportedBrowser(SupportedBrowser.IE, '10')", 651 "@SupportedBrowser(SupportedBrowser.IE, '10')",
(...skipping 28 matching lines...) Expand all
676 "@SupportedBrowser(SupportedBrowser.CHROME)", 680 "@SupportedBrowser(SupportedBrowser.CHROME)",
677 "@SupportedBrowser(SupportedBrowser.FIREFOX)", 681 "@SupportedBrowser(SupportedBrowser.FIREFOX)",
678 "@SupportedBrowser(SupportedBrowser.SAFARI)", 682 "@SupportedBrowser(SupportedBrowser.SAFARI)",
679 ], 683 ],
680 'HTMLProgressElement': [ 684 'HTMLProgressElement': [
681 "@SupportedBrowser(SupportedBrowser.CHROME)", 685 "@SupportedBrowser(SupportedBrowser.CHROME)",
682 "@SupportedBrowser(SupportedBrowser.FIREFOX)", 686 "@SupportedBrowser(SupportedBrowser.FIREFOX)",
683 "@SupportedBrowser(SupportedBrowser.IE, '10')", 687 "@SupportedBrowser(SupportedBrowser.IE, '10')",
684 "@SupportedBrowser(SupportedBrowser.SAFARI)", 688 "@SupportedBrowser(SupportedBrowser.SAFARI)",
685 ], 689 ],
690 'HTMLShadowElement': [
691 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
692 "@Experimental()",
693 ],
686 'HTMLTrackElement': [ 694 'HTMLTrackElement': [
687 "@SupportedBrowser(SupportedBrowser.CHROME)", 695 "@SupportedBrowser(SupportedBrowser.CHROME)",
688 "@SupportedBrowser(SupportedBrowser.IE, '10')", 696 "@SupportedBrowser(SupportedBrowser.IE, '10')",
689 "@SupportedBrowser(SupportedBrowser.SAFARI)", 697 "@SupportedBrowser(SupportedBrowser.SAFARI)",
690 ], 698 ],
691 'IDBFactory': _indexed_db_annotations, 699 'IDBFactory': _indexed_db_annotations,
692 'IDBDatabase': _indexed_db_annotations, 700 'IDBDatabase': _indexed_db_annotations,
701 'ShadowRoot': [
702 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
703 "@Experimental()",
704 ],
693 'WorkerContext.indexedDB': _indexed_db_annotations, 705 'WorkerContext.indexedDB': _indexed_db_annotations,
694 } 706 }
695 707
696 def FindCommonAnnotations(interface_name, member_name=None): 708 def FindCommonAnnotations(interface_name, member_name=None):
697 """ Finds annotations common between dart2js and dartium. 709 """ Finds annotations common between dart2js and dartium.
698 """ 710 """
699 if member_name: 711 if member_name:
700 return dart_annotations.get('%s.%s' % (interface_name, member_name)) 712 return dart_annotations.get('%s.%s' % (interface_name, member_name))
701 else: 713 else:
702 return dart_annotations.get(interface_name) 714 return dart_annotations.get(interface_name)
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 self) 1280 self)
1269 1281
1270 if type_data.clazz == 'SVGTearOff': 1282 if type_data.clazz == 'SVGTearOff':
1271 dart_interface_name = self._renamer.RenameInterface( 1283 dart_interface_name = self._renamer.RenameInterface(
1272 self._database.GetInterface(type_name)) 1284 self._database.GetInterface(type_name))
1273 return SVGTearOffIDLTypeInfo( 1285 return SVGTearOffIDLTypeInfo(
1274 type_name, type_data, dart_interface_name, self) 1286 type_name, type_data, dart_interface_name, self)
1275 1287
1276 class_name = '%sIDLTypeInfo' % type_data.clazz 1288 class_name = '%sIDLTypeInfo' % type_data.clazz
1277 return globals()[class_name](type_name, type_data) 1289 return globals()[class_name](type_name, type_data)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698