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

Re: Some XHR comments

From: Anne van Kesteren <annevk@opera.com>
Date: Wed, 05 Apr 2006 17:46:20 +0200
To: "Boris Zbarsky" <bzbarsky@mit.edu>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>
Message-ID: <op.s7jkrirn64w2qv@id-c0020.oslo.opera.com>

On Wed, 05 Apr 2006 17:33:42 +0200, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> 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.

Could you please point out the bug in my testcase:

  http://xmlhttprequest.testsuite.org/dump/001.htm

... I actually thought there was no implementation where this was this  
case. (I'm testing in Firefox 1.5.x though, which may be a/the problem.)


>>> 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.

Ok.


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

Nice!


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Wednesday, 5 April 2006 15:46:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT