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

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

Issue 227153010: Change HtmlCollection to appear as List<Node> and getElementsByX return ListNode|HtmlCollection (de… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 to provide Dart metadata for 6 """This module provides shared functionality to provide Dart metadata for
7 DOM APIs. 7 DOM APIs.
8 """ 8 """
9 9
10 import copy 10 import copy
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 ], 61 ],
62 62
63 # Normally Window is nevernull, but starting from a <template> element in 63 # Normally Window is nevernull, but starting from a <template> element in
64 # JavaScript, this will be null: 64 # JavaScript, this will be null:
65 # template.content.ownerDocument.defaultView 65 # template.content.ownerDocument.defaultView
66 'Document.window': [ 66 'Document.window': [
67 "@Creates('Window|=Object|Null')", 67 "@Creates('Window|=Object|Null')",
68 "@Returns('Window|=Object|Null')", 68 "@Returns('Window|=Object|Null')",
69 ], 69 ],
70 70
71 'Document.getElementsByTagName': [
72 "@Creates('NodeList|HtmlCollection')",
73 "@Returns('NodeList|HtmlCollection')",
74 ],
75
76 'Document.getElementsByClassName': [
77 "@Creates('NodeList|HtmlCollection')",
78 "@Returns('NodeList|HtmlCollection')",
79 ],
80
71 # Methods returning Window can return a local window, or a cross-frame 81 # Methods returning Window can return a local window, or a cross-frame
72 # window (=Object) that needs wrapping. 82 # window (=Object) that needs wrapping.
73 'Window': [ 83 'Window': [
74 "@Creates('Window|=Object')", 84 "@Creates('Window|=Object')",
75 "@Returns('Window|=Object')", 85 "@Returns('Window|=Object')",
76 ], 86 ],
77 87
78 'Window.openDatabase': [ 88 'Window.openDatabase': [
79 "@Creates('SqlDatabase')", 89 "@Creates('SqlDatabase')",
80 ], 90 ],
81 91
82 'Window.showModalDialog': [ 92 'Window.showModalDialog': [
83 "@Creates('Null')", 93 "@Creates('Null')",
84 ], 94 ],
85 95
86 'Element.webkitGetRegionFlowRanges': [ 96 'Element.webkitGetRegionFlowRanges': [
87 "@Creates('JSExtendableArray')", 97 "@Creates('JSExtendableArray')",
88 "@Returns('JSExtendableArray')", 98 "@Returns('JSExtendableArray')",
89 ], 99 ],
90 100
101 'Element.getElementsByTagName': [
102 "@Creates('NodeList|HtmlCollection')",
103 "@Returns('NodeList|HtmlCollection')",
104 ],
105
106 'Element.getElementsByClassName': [
107 "@Creates('NodeList|HtmlCollection')",
108 "@Returns('NodeList|HtmlCollection')",
109 ],
110
91 "ErrorEvent.error": [ 111 "ErrorEvent.error": [
92 "@Creates('Null')", # Only returns values created elsewhere. 112 "@Creates('Null')", # Only returns values created elsewhere.
93 ], 113 ],
94 114
95 # To be in callback with the browser-created Event, we had to have called 115 # To be in callback with the browser-created Event, we had to have called
96 # addEventListener on the target, so we avoid 116 # addEventListener on the target, so we avoid
97 'Event.currentTarget': [ 117 'Event.currentTarget': [
98 "@Creates('Null')", 118 "@Creates('Null')",
99 "@Returns('EventTarget|=Object')", 119 "@Returns('EventTarget|=Object')",
100 ], 120 ],
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 268
249 'RTCStatsReport.timestamp': [ 269 'RTCStatsReport.timestamp': [
250 "@Creates('Null')", # JS date object. 270 "@Creates('Null')", # JS date object.
251 ], 271 ],
252 272
253 'SerializedScriptValue': [ 273 'SerializedScriptValue': [
254 "@annotation_Creates_SerializedScriptValue", 274 "@annotation_Creates_SerializedScriptValue",
255 "@annotation_Returns_SerializedScriptValue", 275 "@annotation_Returns_SerializedScriptValue",
256 ], 276 ],
257 277
278 'ShadowRoot.getElementsByTagName': [
279 "@Creates('NodeList|HtmlCollection')",
280 "@Returns('NodeList|HtmlCollection')",
281 ],
282
283 'ShadowRoot.getElementsByClassName': [
284 "@Creates('NodeList|HtmlCollection')",
285 "@Returns('NodeList|HtmlCollection')",
286 ],
287
258 'SQLResultSetRowList.item': ["@Creates('=Object')"], 288 'SQLResultSetRowList.item': ["@Creates('=Object')"],
259 289
260 # Touch targets are Elements in a Document, or the Document. 290 # Touch targets are Elements in a Document, or the Document.
261 'Touch.target': [ 291 'Touch.target': [
262 "@Creates('Element|Document')", 292 "@Creates('Element|Document')",
263 "@Returns('Element|Document')", 293 "@Returns('Element|Document')",
264 ], 294 ],
265 295
266 'TrackEvent.track': [ 296 'TrackEvent.track': [
267 "@Creates('Null')", 297 "@Creates('Null')",
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 pass 819 pass
790 else: 820 else:
791 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) 821 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id))
792 822
793 return annotations 823 return annotations
794 824
795 def Flush(self): 825 def Flush(self):
796 json_file = open(self._api_status_path, 'w+') 826 json_file = open(self._api_status_path, 'w+')
797 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key s=True) 827 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key s=True)
798 json_file.close() 828 json_file.close()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698