W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

[whatwg] Session history and discarding of Documents

From: Andrew Oakley <andrew@ado.is-a-geek.net>
Date: Mon, 29 Jul 2013 15:49:37 +0100
Message-ID: <51F68101.8080408@ado.is-a-geek.net>
To: whatwg <whatwg@lists.whatwg.org>
As far as I can tell when the user agent discards a Document in the
session history may change the contents of the history.  This seems
wrong to me because it makes non-deterministic visible to scripting.

The scenario that I'm thinking of is:
"index" has a frame that is navigated to:
	"container" which has a frame that is navigated to:
		"page1" (default using src=page1)
		"page2"

The "joint session history" now contains (elements in parenthesis are
removed because they are "current entries in their respective session
histories"):
(index) (container) page1 page2

If "container" is now navigated to "empty" we get this:
(index) container empty

Now if we go back() and the Document for "container" has not been
discarded and therefore the nested browsing context exists we get page2
visible in the frame and this joint session history:
(index) (container) page1 page2 empty

If the Document for "container" had been discarded then the nested
browsing context and it's session history is discarded.  This means that
page1 is visible in the frame and we get this joint session history:
(index) (container) page1 empty

Apologies if the above description is confusing, it's rather difficult
to describe.

I have not managed to find a way to get desktop browsers to actually
discard the Document for "container", I'm guessing there is some sort of
heuristic based on memory available.  In a memory-constrained
environment a browser may wish to destroy the Document's fairly quickly
and I expect to see the second behaviour.

Have I missed something or misunderstood the spec here?  As far as I can
tell there is actually no requirement to maintain session history for
any nested browsing context that belongs to a document which is not
active but the major browser do.

Thanks

-- 
Andrew Oakley

-- 
Andrew Oakley
Received on Monday, 29 July 2013 14:50:02 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC