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

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

Issue 23064024: Attempt to land Dartium roll a second time. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
« no previous file with comments | « tools/dom/scripts/htmldartgenerator.py ('k') | tools/dom/scripts/htmlrenamer.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 functionality to generate dart:html event classes.""" 6 """This module provides functionality to generate dart:html event classes."""
7 7
8 import logging 8 import logging
9 import monitored 9 import monitored
10 10
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 + provider), call_name)), 321 + provider), call_name)),
322 TYPE=event_type) 322 TYPE=event_type)
323 323
324 def _GetRawEvents(self, interface): 324 def _GetRawEvents(self, interface):
325 all_interfaces = ([ interface ] + 325 all_interfaces = ([ interface ] +
326 self._database.TransitiveSecondaryParents(interface)) 326 self._database.TransitiveSecondaryParents(interface))
327 events = set([]) 327 events = set([])
328 for super_interface in all_interfaces: 328 for super_interface in all_interfaces:
329 events = events.union( 329 events = events.union(
330 set([attr.id for attr in super_interface.attributes 330 set([attr.id for attr in super_interface.attributes
331 if attr.type.id == 'EventListener'])) 331 if (attr.type.id == 'EventHandler'
332 or attr.type.id == 'EventListener')]))
332 return events 333 return events
333 334
334 def _GetEvents(self, interface, custom_events): 335 def _GetEvents(self, interface, custom_events):
335 """ Gets a list of all of the events for the specified interface. 336 """ Gets a list of all of the events for the specified interface.
336 """ 337 """
337 html_interface_name = interface.doc_js_name 338 html_interface_name = interface.doc_js_name
338 339
339 events = self._GetRawEvents(interface) 340 events = self._GetRawEvents(interface)
340 341
341 if html_interface_name in _html_manual_events: 342 if html_interface_name in _html_manual_events:
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 """ 403 """
403 key = '%s.%s' % (html_interface_name, dom_event_name) 404 key = '%s.%s' % (html_interface_name, dom_event_name)
404 if key in _html_event_types: 405 if key in _html_event_types:
405 return _html_event_types[key] 406 return _html_event_types[key]
406 key = '*.%s' % dom_event_name 407 key = '*.%s' % dom_event_name
407 if key in _html_event_types: 408 if key in _html_event_types:
408 return _html_event_types[key] 409 return _html_event_types[key]
409 _logger.warn('Cannot resolve event type for %s.%s' % 410 _logger.warn('Cannot resolve event type for %s.%s' %
410 (html_interface_name, dom_event_name)) 411 (html_interface_name, dom_event_name))
411 return None 412 return None
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmldartgenerator.py ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698