Re: How to get event listener method inheritance clarified

On 9/18/09 10:31 AM, Cameron McCormack wrote:
> Hi Christopher.
>
> Christopher M. Balz:
>> Imho, the DOM spec should clearly state where the 'addEventListener'
>> and 'removeEventListener' methods should be located in the 'Element'
>> inheritance hierarchy.
>> …
>> Could this be included in a spec update?
>
> Web IDL specifies this, but not currently in a way that describes what
> implementations do at the moment:
>
>    http://dev.w3.org/2006/webapi/WebIDL/#interface-prototype-object
>
> We’ll see how well the browser vendors take to it once we go to Last
> Call.
>
So how does webidl handle cases like window and XHR?
I mean, what if a script library wants to replace .addEventListener on
all the objects which implement EventTarget.

Based on the http://dev.w3.org/2006/webapi/WebIDL/#PrototypeRoot example
there would be a separate mixin object for each node type and XHR and 
window etc. I don't think we want that, at least not for EventTarget.

I wonder if we could define that EventTarget is the [PrototypeRoot].

-Olli

Received on Monday, 21 September 2009 08:32:22 UTC