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

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

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 14 Dec 2012 20:38:32 +0000 (UTC)
To: Anne van Kesteren <annevk@annevk.nl>
cc: Boris Zbarsky <bzbarsky@mit.edu>, Jungkee Song <jungkee.song@samsung.com>, public-webapps@w3.org
Message-ID: <Pine.LNX.4.64.1212142037450.12469@ps20323.dreamhostps.com>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:56 GMT