W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2012

Re: [XHR] Constructor behavior seems to be underdefined

From: Anne van Kesteren <annevk@opera.com>
Date: Sat, 31 Mar 2012 10:17:32 +0200
To: public-webapps@w3.org, "public-script-coord@w3.org" <public-script-coord@w3.org>, "Boris Zbarsky" <bzbarsky@mit.edu>
Message-ID: <op.wb0zzik364w2qv@annevk-macbookpro.local>
On Sat, 31 Mar 2012 01:29:05 +0200, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> Now consider a web page with two subframes and a script that has  
> references to the two subframe windows in variables w1 and w2.  Then the  
> script does this:
>
>    w1.XMLHttpRequest = w2.XMLHttpRequest;
>    var xhr = new w1.XMLHttpRequest();
>
> What's the document associated with xhr?  Is it w1.document,  
> w2.document, or window.document?  The concept "the Window object for  
> which the XMLHttpRequest interface object was created" doesn't seem to  
> be defined anywhere....

So this was defined this way the last time you brought this up. I believe  
it should be w2.document which is different from how most constructors  
behave (e.g. Image), because that is what IE does and you wanted to be  
compatible with that. The testsuite does not test w1.XMLHttpRequest =  
w2.XMLHttpRequest explicitly, because nothing should happen there except  
referencing the interface object from elsewhere. It does test constructing  
an interface object from a different window and then checking how URLs  
resolve. See the multi-window tests.


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Saturday, 31 March 2012 08:18:38 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:05 UTC