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

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?

In Opera and Safari, it's the former (the document). In Firefox it's the  
latter (the window).

Same thing for the 'change' event.

I think Firefox's behavior makes more sense, but I'm not sure what the  
spec says. I see  
<http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#events-and-the-window-object>  
and  
<http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#the-window-object>,  
but still not sure.

-- 
Michael

Received on Saturday, 20 June 2009 09:22:35 UTC