W3C home > Mailing lists > Public > public-html@w3.org > July 2009

Re: event.currentTarget and 'this' for listeners registered on the window object

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 14 Jul 2009 05:36:31 +0000 (UTC)
To: "Michael A. Puls II" <shadow2531@gmail.com>
Cc: public-html@w3.org
Message-ID: <Pine.LNX.4.62.0907140533070.23663@hixie.dreamhostps.com>
On Sat, 20 Jun 2009, Michael A. Puls II wrote:
>
> window.addEventListener("input", function(e) {
>     alert(e.currentTarget)
> }, false);
> 
> Should e.currentTarget and 'this' be equivalent to e.target.ownerDocument or
> e.target.ownerDocument.defaultView?

The DOM3 Events spec seems clear that the currentTarget should be the 
object on which the events are registered (window in this case).

I'm not sure what any spec says about "this", but that seems out of scope 
for HTML5. I recommend raising this with www-dom for DOM3 Events.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 14 July 2009 05:37:07 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:48 UTC