| 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
|
| }
|
|
|