[whatwg] How long should sessionStorage data persist?

Ian Hickson ian at hixie.ch
Fri Apr 3 18:46:59 PDT 2009


On Fri, 3 Apr 2009, Boris Zbarsky wrote:
> Ian Hickson wrote:
> > The term "browsing context" in the spec basically corresponds to the 
> > session history exposed by window.history, and the outer "Window" 
> > object that the history is on.
> 
> How should this behave in a situation like Firefox's "undo close tab", 
> where the resulting tab has a brand-new window object but the 
> window.history has been deserialized from a string representation.  So 
> it's a new object, but has the same information in it as the old one 
> used to.
> 
> Presumably in such a case this should be treated as "the same" browsing 
> context in spite of the Window object being totally different?

>From the HTML5 spec's point of view, that's a new browsing context. 
There's a 1:1 mapping from "browsing context" to "outer Window" (called 
WindowProxy in the spec).

However, the Web Storage spec allows for this case:

| When a new top-level browsing context is created by cloning an existing 
| browsing context, the new browsing context must start with the same 
| session storage areas as the original, but the two sets must from that 
| point on be considered separate, not affecting each other in any way.

This was originally intended to cover IE's "open new window" 
functionality, which options a new window with a cloned session history, 
but "Undo close tab" should be considered a case of cloning a browsing 
context too. It just happens that the underlying browsing context is no 
longer accessible from script.

-- 
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