RE: Functions that Implement the EventListener Interface (DOM Level 3 Events)

Thanks for pointing out the typo. I’ve corrected this.

-Jacob

From: dominicc@google.com [mailto:dominicc@google.com] On Behalf Of Dominic Cooney
Sent: Saturday, August 06, 2011 8:15 AM
To: Rob Brackett
Cc: Jacob Rossi; schepers@w3.org; Jonas Sicking; Cameron McCormack; Olli@pettay.fi; www-dom@w3.org
Subject: Re: Functions that Implement the EventListener Interface (DOM Level 3 Events)

I believe this new text is incorrect at the highlighted point:

The listener parameter must be either an object that implements the EventListener interface or a function. If listener is a function then it must be used as the callback for the event; otherwise, if listener implements ***EventTarget***, then its handleEvent method must be used as the callback. If listener is a function that also has a handleEvent method, the function itself must be used as the callback and not its handleEvent method.

It should read:

The listener parameter must be either an object that implements the EventListener interface or a function. If listener is a function then it must be used as the callback for the event; otherwise, if listener implements EventListener, then its handleEvent method must be used as the callback. If listener is a function that also has a handleEvent method, the function itself must be used as the callback and not its handleEvent method.

Sincerely,

Dominic

On Thu, Jun 30, 2011 at 11:30 AM, Rob Brackett <rbrackett@apple.com<mailto:rbrackett@apple.com>> wrote:

On Jun 24, 2011, at 10:27 AM, Jacob Rossi wrote:

Hi Rob,

Sorry for a late reply. First, I completely agree that what's currently in the spec is just broken. The second paragraph is the intended spec'd behavior--the others need to be removed.

Since it doesn't seem like there is much interest in changing the specified behavior, this is what I'd like to request as well. I think the following wording (or something similar) would be pretty good for the description of the "listener" parameter of the EventTarget interface's addEventListener() method:

The listener parameter must be either an object that implements the EventListener interface or a function. If listener is a function then it must be used as the callback for the event; otherwise, if listener implements EventTarget, then its handleEvent method must be used as the callback. If listener is a function that also has a handleEvent method, the function itself must be used as the callback and not its handleEvent method.

This is basically the same as the current second paragraph from the current spec. I've added one sentence at the end to make the use case in question as clear as possible since it does not seem like D3 Events is using attributes in its IDL (should attributes like [Callback] be used in D3 Events?).
Thanks!

-Rob

Received on Tuesday, 9 August 2011 17:41:07 UTC