[whatwg] location.reload() on document.open()ed documents

Ian Hickson ian at hixie.ch
Tue Dec 7 14:10:31 PST 2010


On Tue, 24 Aug 2010, Boris Zbarsky wrote:
> On 8/24/10 6:13 PM, Ian Hickson wrote:
> > So basically, translating this to specese:
> > 
> >     Document objects on which you call open() have an "override reload"
> >     flag set and an initially empty source cache added.
> > 
> >     When you call document.write() on a document with the "override reload"
> >     flag set, also append the text to the document source cache.
> > 
> >     When you reload a document that has the "override reload" flag set,
> >     instead of reloading from the network, just stream the data in from the
> >     document source cache.
> > 
> > Is that right?
> 
> That seems like an accurate description of the Gecko behavior.

After some discussion with some other browser vendors, I've specced this. 
The other browser vendors didn't seem especially enthusiastic about it, 
but did not say they wouldn't implement it eventually...


> There's some weirdness in terms of the document encoding being set to 
> whatever it's set to while the data is actually just read directly as 
> UTF-16, etc, but that seems like an implementation detail; the spec just 
> needs to specify that the data is read as characters, not bytes, and 
> what the document encoding should be set to.

The spec is a little hand-wavy about this, but if it's unclear I'll fix it 
in a subsequent patch. (It uses basically the same hand-wavy terminology 
as is used for other invocations of the parser from a string.)


> > Also doing this for history navigation is rather scary too, but I 
> > guess could be done.
> 
> History navigation across document.open() is supported in at least IE 
> and Gecko right now.  I seem to recall it being rather broken if 
> supported at all in Webkit.  I don't know that I've ever tested Opera.

Per spec, currently document.open() replaces the current page rather than 
allow navigation. I'm not sure how to allow navigation since the Document 
doesn't change but still can't be reused.

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


More information about the whatwg mailing list