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

Side by Side Diff: sdk/lib/html/scripts/htmldartgenerator.py

Issue 11469039: Make ScriptProcessorNode not a proper event (because it isn't). This fixes the last of the static a… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: renamed non-event variable in script Created 8 years 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
« no previous file with comments | « no previous file | sdk/lib/html/scripts/htmleventgenerator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 the system to generate 6 """This module provides shared functionality for the system to generate
7 dart:html APIs from the IDL database.""" 7 dart:html APIs from the IDL database."""
8 from htmleventgenerator import html_override_event_classes
8 9
9 from generator import AnalyzeOperation, ConstantOutputOrder, \ 10 from generator import AnalyzeOperation, ConstantOutputOrder, \
10 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \ 11 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \
11 IsPureInterface 12 IsPureInterface
12 13
13 # Types that are accessible cross-frame in a limited fashion. 14 # Types that are accessible cross-frame in a limited fashion.
14 # In these cases, the base type (e.g., Window) provides restricted access 15 # In these cases, the base type (e.g., Window) provides restricted access
15 # while the subtype (e.g., LocalWindow) provides full access to the 16 # while the subtype (e.g., LocalWindow) provides full access to the
16 # corresponding objects if there are from the same frame. 17 # corresponding objects if there are from the same frame.
17 _secure_base_types = { 18 _secure_base_types = {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 'EventTarget.removeEventListener, EventTarget.dispatchEvent;' 52 'EventTarget.removeEventListener, EventTarget.dispatchEvent;'
52 ' @docsEditable true' 53 ' @docsEditable true'
53 '\n $TYPE get on =>\n new $TYPE(this);\n', 54 '\n $TYPE get on =>\n new $TYPE(this);\n',
54 TYPE=events_class_name) 55 TYPE=events_class_name)
55 56
56 def AddMembers(self, interface, declare_only=False): 57 def AddMembers(self, interface, declare_only=False):
57 for const in sorted(interface.constants, ConstantOutputOrder): 58 for const in sorted(interface.constants, ConstantOutputOrder):
58 self.AddConstant(const) 59 self.AddConstant(const)
59 60
60 for attr in sorted(interface.attributes, ConstantOutputOrder): 61 for attr in sorted(interface.attributes, ConstantOutputOrder):
61 if attr.type.id != 'EventListener': 62 if (attr.type.id != 'EventListener' or
63 interface.id in html_override_event_classes):
62 self.AddAttribute(attr, declare_only) 64 self.AddAttribute(attr, declare_only)
63 65
64 # The implementation should define an indexer if the interface directly 66 # The implementation should define an indexer if the interface directly
65 # extends List. 67 # extends List.
66 element_type = None 68 element_type = None
67 requires_indexer = False 69 requires_indexer = False
68 if self._interface_type_info.list_item_type(): 70 if self._interface_type_info.list_item_type():
69 self.AddIndexer(self._interface_type_info.list_item_type()) 71 self.AddIndexer(self._interface_type_info.list_item_type())
70 else: 72 else:
71 for parent in self._database.Hierarchy(self._interface): 73 for parent in self._database.Hierarchy(self._interface):
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 walk(interface.parents) 331 walk(interface.parents)
330 else: 332 else:
331 walk(interface.parents[1:]) 333 walk(interface.parents[1:])
332 return result 334 return result
333 335
334 def _DartType(self, type_name): 336 def _DartType(self, type_name):
335 return self._type_registry.DartType(type_name) 337 return self._type_registry.DartType(type_name)
336 338
337 def _IsPrivate(self, name): 339 def _IsPrivate(self, name):
338 return name.startswith('_') 340 return name.startswith('_')
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/scripts/htmleventgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698