Re: Some XHR comments

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 UTC