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

On Fri, Dec 14, 2012 at 7:31 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> Though the real question is whether this:
>
>
>   <script>
>     window.onload = function() {
>       document.open();
>       var xhr = new XMLHttpRequest();
>       xhr.open("GET", "");
>       xhr.send();
>     }
>   </script>
>
> should really throw or not...  It's a slightly weird case where the Window
> the code is running in is no longer the currently active Window but the page
> is sort of still around, kinda.

It seems to depend on whether or not the old Window object still has
an associated document. If it still points to the active document the
above "would work". If it points nowhere the above cannot work and
we'd have to throw somewhere (constructor seems fine to me if that's
easier).

Ian, ideas?


-- 
http://annevankesteren.nl/

Received on Friday, 14 December 2012 18:56:22 UTC