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

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

Issue 109473009: Removing media events from Document and Element. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 if html_name == event_name and event_type == found_type: 375 if html_name == event_name and event_type == found_type:
376 return True 376 return True
377 return False 377 return False
378 378
379 def _IsEventSuppressed(self, interface, event_name, event_type): 379 def _IsEventSuppressed(self, interface, event_name, event_type):
380 """ Checks if the event should not be emitted. 380 """ Checks if the event should not be emitted.
381 """ 381 """
382 if self._renamer.ShouldSuppressMember(interface, event_name, 'on:'): 382 if self._renamer.ShouldSuppressMember(interface, event_name, 'on:'):
383 return True 383 return True
384 384
385 if interface.doc_js_name == 'Window': 385 if (interface.doc_js_name == 'Window' or
386 interface.doc_js_name == 'Element' or
387 interface.doc_js_name == 'Document'):
386 media_interface = self._database.GetInterface('HTMLMediaElement') 388 media_interface = self._database.GetInterface('HTMLMediaElement')
387 media_events = self._GetEvents(media_interface, []) 389 media_events = self._GetEvents(media_interface, [])
388 if self._HasEvent(media_events, event_name, event_type): 390 if self._HasEvent(media_events, event_name, event_type):
389 return True 391 return True
390 392
391 def _GetEventRedirection(self, interface, event_name, event_type): 393 def _GetEventRedirection(self, interface, event_name, event_type):
392 """ For events which are declared in one place, but exposed elsewhere, 394 """ For events which are declared in one place, but exposed elsewhere,
393 this gets the source of the event (where the provider is declared) 395 this gets the source of the event (where the provider is declared)
394 """ 396 """
395 if interface.doc_js_name == 'Window' or interface.doc_js_name == 'Document': 397 if interface.doc_js_name == 'Window' or interface.doc_js_name == 'Document':
396 element_interface = self._database.GetInterface('Element') 398 element_interface = self._database.GetInterface('Element')
397 element_events = self._GetEvents(element_interface, []) 399 element_events = self._GetEvents(element_interface, [])
398 if self._HasEvent(element_events, event_name, event_type): 400 if self._HasEvent(element_events, event_name, event_type):
399 return 'Element' 401 return 'Element'
400 return None 402 return None
401 403
402 def _FindEventInfo(self, html_interface_name, dom_event_name): 404 def _FindEventInfo(self, html_interface_name, dom_event_name):
403 """ Finds the event info (event name and type). 405 """ Finds the event info (event name and type).
404 """ 406 """
405 key = '%s.%s' % (html_interface_name, dom_event_name) 407 key = '%s.%s' % (html_interface_name, dom_event_name)
406 if key in _html_event_types: 408 if key in _html_event_types:
407 return _html_event_types[key] 409 return _html_event_types[key]
408 key = '*.%s' % dom_event_name 410 key = '*.%s' % dom_event_name
409 if key in _html_event_types: 411 if key in _html_event_types:
410 return _html_event_types[key] 412 return _html_event_types[key]
411 _logger.warn('Cannot resolve event type for %s.%s' % 413 _logger.warn('Cannot resolve event type for %s.%s' %
412 (html_interface_name, dom_event_name)) 414 (html_interface_name, dom_event_name))
413 return None 415 return None
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698