W3C home > Mailing lists > Public > public-webapi@w3.org > April 2006

Re: Some XHR comments

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Wed, 05 Apr 2006 10:33:42 -0500
Message-ID: <4433E356.1040503@mit.edu>
To: "Web APIs WG (public)" <public-webapi@w3.org>

Anne van Kesteren wrote:
>> An EventListener has the advantage of being an existing interface, but
>> somehow it seems weird to use it if XHR isn't an EventTarget.
> I agree. I actually want XHR to be an EventTarget as well because it 
> makes sense, but the only problem is that there's no implementation for 
> that...

It's an EventTarget in Gecko.

>> There's also the issue of what you pass as the Event object to 
>> handleEvent.
>> I notice that Mozilla recently made a decision wrt this
>> (https://bugzilla.mozilla.org/show_bug.cgi?id=198595).
> Yeah, there should be an open issue on that. I'd like `this` to return 
> the XMLHttpRequest object. Opera does that. Internet Explorer and Safari 
> return the Window object. Mozilla returns the Function object you passed 
> to onreadystatechange...

Note that the behavior of |this| in this function is somewhat independent of 
whether we're looking at an EventListener.

Also note that https://bugzilla.mozilla.org/show_bug.cgi?id=198595 in fact 
changes the |this| in Gecko to be the XMLHttpRequest object.

Received on Wednesday, 5 April 2006 15:33:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:20 UTC