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

Unified Diff: tools/dom/templates/html/impl/impl_EventTarget.darttemplate

Issue 569783002: Migrate to Chrome 37 IDL (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/templates/html/impl/impl_EventTarget.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
index d1a23cf0422571d823862b257be409e1dcefacac..8cb282ea9271b875405d2f4026834cb4fb2218db 100644
--- a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
+++ b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
@@ -100,5 +100,24 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
* used when an explicit accessor is not available.
*/
Events get on => new Events(this);
+
+ void addEventListener(String type, EventListener listener, [bool useCapture]) {
+ // TODO(leafp): This check is avoid a bug in our dispatch code when
+ // listener is null. The browser treats this call as a no-op in this
+ // case, so it's fine to short-circuit it, but we should not have to.
+ if (listener != null) {
+ _addEventListener(type, listener, useCapture);
+ }
+ }
+
+ void removeEventListener(String type, EventListener listener, [bool useCapture]) {
+ // TODO(leafp): This check is avoid a bug in our dispatch code when
+ // listener is null. The browser treats this call as a no-op in this
+ // case, so it's fine to short-circuit it, but we should not have to.
+ if (listener != null) {
+ _removeEventListener(type, listener, useCapture);
+ }
+ }
+
$!MEMBERS
}

Powered by Google App Engine
This is Rietveld 408576698