[whatwg] Clarification on joint session history
Ben Lerner
t-benle at microsoft.com
Wed Jun 23 10:52:05 PDT 2010
Hi all,
According to the spec,
The joint session history of a History<http://www.whatwg.org/specs/web-apps/current-work/#history-0> object is the union of all the session histories<http://www.whatwg.org/specs/web-apps/current-work/#session-history> of all browsing contexts<http://www.whatwg.org/specs/web-apps/current-work/#browsing-context> of all the fully active<http://www.whatwg.org/specs/web-apps/current-work/#fully-active> Document<http://www.whatwg.org/specs/web-apps/current-work/#document> objects that share the History<http://www.whatwg.org/specs/web-apps/current-work/#history-0> object'stop-level browsing context<http://www.whatwg.org/specs/web-apps/current-work/#top-level-browsing-context>, with all the entries that are current entries<http://www.whatwg.org/specs/web-apps/current-work/#current-entry> in their respective session histories<http://www.whatwg.org/specs/web-apps/current-work/#session-history> removed except for the current entry of the joint session history<http://www.whatwg.org/specs/web-apps/current-work/#current-entry-of-the-joint-session-history>.
This was changed as part of bug 7858 (http://www.w3.org/Bugs/Public/show_bug.cgi?id=7858), but I'm not sure I understand it fully. Suppose I have a document D1 with two sibling iframes, initially navigated to documents D2 and D3. The joint session history at this point should contain one entry, right? But is it D1, D2 or D3? Section 6.5.2 defines the page load processing model for HTML files, and says "After creating the Document object, but before any script execution, certainly before the parser stops, the user agent must update the session history with the new page." It doesn't say anything about the relative maturations of multiple parsers handling multiple documents. From experimentation with real browsers, it appears that the history entry should be D1. But I could reasonably finish parsing D1, process the iframe attributes for the first time, running the navigation algorithm up to step 12 ("... must continue these steps asynchronously"), then finish parsing D1 and update its session history, before resuming the navigation algorithm, parsing D2 and updating the iframe's session history. It seems I could even reasonably finish the two iframes in either order. This would lead to any of D1, D2 or D3 being the most recent entry in the session histories.
Ok, next. If I click a link inside D2 and navigate that iframe to a new document D4, what should the joint session history now contain? It seems to me from browsing the web that it ought to be "whatever it was before, plus D4", making it "D1, D4". But a literal reading of the joint-session-history definition above seems to contradict that: D1 is the current entry of the top-level session history, but it's no longer the current entry of the joint session history, so it must be removed from the joint session history, making the joint session history be merely "D4". What am I missing?
To push it one step further, click on a link in D3, and navigate it to D5. I'd expect the joint session history to be "D1, D4, D5", but again a literal reading seems to indicate that it will now be simply "D5".
I hope this made some sense... any clarifications will be much appreciated :)
Thanks,
Ben Lerner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100623/7fd13977/attachment-0002.htm>
More information about the whatwg
mailing list