W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2009

Re: Hypothetical WebIDL block for EventTarget

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 14 Oct 2009 13:58:35 -0700
Cc: "www-dom@w3.org" <www-dom@w3.org>
Message-id: <CC6C6D43-222E-4E57-B7A5-1B0222DAFED0@apple.com>
To: Travis Leithead <travil@microsoft.com>

On Oct 14, 2009, at 12:26 PM, Travis Leithead wrote:

> I realize I'm touching on a controversial topic, but I was wondering  
> what feedback we might get by proposing that the EventTarget  
> interface in DOM Level 3 Events be marked up with WebIDL as follows  
> (I don't imagine controversy on any other interface):
>
> [NoInterfaceObject]
> interface EventTarget {
>  void               addEventListener(in DOMString type,
>                                      in EventListener listener,
>                                      in boolean useCapture);
>  void               removeEventListener(in DOMString type,
>                                         in EventListener listener,
>                                         in boolean useCapture);
>  // Modified in DOM Level 3:
>  boolean            dispatchEvent(in Event evt)
>                                   raises(EventException,
>                                   DOMException);
> };
>
> Note, this is different from http://dev.w3.org/2006/webapi/WebIDL/dom/dom2events.idl
> The point of contention is whether EventTarget should be bound to an  
> "interface object" in the ECMAScript binding or whether it  
> participates in the mix-in algorithm, however that will end up  
> working (not finalized in WebIDL at the moment).

I think it makes sense that interfaces meant to be used as mixins  
don't produce a prototype object.

> For reference:
>
> Browser     this.hasOwnProperty("EventTarget")

You should use ("EventTarget" in window) as the test. hasOwnProperty  
will miss prototype properties.

> ===============================================
> IE8		false
> FF3.5		false (but EventTarget.prototype exists)?
> Safari4	false
> Opera10	false
>
Received on Wednesday, 14 October 2009 20:59:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:03 GMT