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

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