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

Unified Diff: tools/dom/scripts/htmleventgenerator.py

Issue 21607003: Add Event delegation to Elements and groups of elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: tools/dom/scripts/htmleventgenerator.py
diff --git a/tools/dom/scripts/htmleventgenerator.py b/tools/dom/scripts/htmleventgenerator.py
index b6566afec89f12b1c67c76d2517e94db65082670..114c1f20ec27d91d48823619eb2c3c54d7baa41d 100644
--- a/tools/dom/scripts/htmleventgenerator.py
+++ b/tools/dom/scripts/htmleventgenerator.py
@@ -291,11 +291,14 @@ class HtmlEventGenerator(object):
annotations = self._metadata.GetFormattedMetadata(
library_name, interface, annotation_name, ' ')
+ isElement = ('Element' in interface.id and
+ 'ElementInstance' not in interface.id)
members_emitter.Emit(
"\n"
- " $(ANNOTATIONS)Stream<$TYPE> get $(NAME) => "
- "$PROVIDER.forTarget(this);\n",
+ " $(ANNOTATIONS)$(ELEM_TYPE)Stream<$TYPE> get $(NAME) => "
+ "$PROVIDER.for$(ELEM_TYPE)Target(this);\n",
ANNOTATIONS=annotations,
+ ELEM_TYPE='Element' if isElement else '',
NAME=getter_name,
PROVIDER=provider,
TYPE=event_type)

Powered by Google App Engine
This is Rietveld 408576698