W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

[XHR] Need to define the behavior when the Window the XHR is created from does not have an associated document

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 13 Dec 2012 12:50:10 -0500
Message-ID: <50CA1552.9060509@mit.edu>
To: public-webapps@w3.org
The spec currently says:

   In environments where the global object is represented by the Window
   object the XMLHttpRequest object has an associated XMLHttpRequest
   document which is the document associated with the Window object for
   which the XMLHttpRequest interface object was created.

Now consider this testcase:

     window.onload = function() {
       var xhr = new XMLHttpRequest();

What is the "XMLHttpRequest document" in this case?  Note that 
document.open() creates a new Window object in this case, but the 
unqualified name lookup finds the XMLHttpRequest constructor on the old 
Window still.  In particular, in the case above this:

   alert(XMLHttpRequest == window.XMLHttpRequest);

alerts false per spec as far as I can tell, and the old Window is no 
longer associated with the document at this point.

What should happen in this case?

Received on Thursday, 13 December 2012 17:50:40 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:50 UTC