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

On Fri, 14 Dec 2012, Anne van Kesteren wrote:
> 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?

Windows themselves don't "point" anywhere. There's a variety of 
relationships from Window objects to Document objects (and vice versa). 
What's the precise text or script you're asking about?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 14 December 2012 20:38:59 UTC