Skip to content

Commit

Permalink
[giow] (3) Session history traversal in a multi-process world. I have…
Browse files Browse the repository at this point in the history
… no idea what I'm doing.

Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@8199 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 25, 2013
1 parent 36c871b commit 252bc97
Show file tree
Hide file tree
Showing 3 changed files with 239 additions and 119 deletions.
117 changes: 76 additions & 41 deletions complete.html
Expand Up @@ -256,7 +256,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 24 September 2013</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 25 September 2013</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -66966,7 +66966,7 @@ <h3 id=sandboxing><span class=secno>6.4 </span>Sandboxing</h3>
<li><p>The flags set on the <code><a href=#document>Document</a></code>'s resource's <a href=#forced-sandboxing-flag-set>forced sandboxing flag
set</a>, if it has one.</li>

</ul><h3 id=history><span class=secno>6.5 </span>Session history and navigation</h3>
</ul><!--CLEANUP--><h3 id=history><span class=secno>6.5 </span>Session history and navigation</h3>

<h4 id=the-session-history-of-browsing-contexts><span class=secno>6.5.1 </span>The session history of browsing contexts</h4>

Expand Down Expand Up @@ -67115,6 +67115,7 @@ <h4 id=the-session-history-of-browsing-contexts><span class=secno>6.5.1 </span>T
</div>



<!--TOPIC:DOM APIs-->
<h4 id=the-history-interface><span class=secno>6.5.2 </span>The <code><a href=#history-0>History</a></code> interface</h4>

Expand Down Expand Up @@ -67192,10 +67193,10 @@ <h4 id=the-history-interface><span class=secno>6.5.2 </span>The <code><a href=#h

</dd>

</dl><!--TOPIC:HTML--><p>The <dfn id=joint-session-history>joint session history</dfn> of a <code><a href=#history-0>History</a></code> object is the union of all the
</dl><!--TOPIC:HTML--><p>The <dfn id=joint-session-history>joint session history</dfn> of a <a href=#top-level-browsing-context>top-level browsing context</a> is the union of all the
<a href=#session-history title="session history">session histories</a> of all <a href=#browsing-context title="browsing
context">browsing contexts</a> of all the <a href=#fully-active>fully active</a> <code><a href=#document>Document</a></code>
objects that share the <code><a href=#history-0>History</a></code> object's <a href=#top-level-browsing-context>top-level browsing context</a>, with
objects that share that <a href=#top-level-browsing-context>top-level browsing context</a>, with
all the entries that are <a href=#current-entry title="current entry">current entries</a> in their respective
<a href=#session-history title="session history">session histories</a> removed except for the <a href=#current-entry-of-the-joint-session-history>current entry
of the joint session history</a>.</p>
Expand All @@ -67204,19 +67205,23 @@ <h4 id=the-history-interface><span class=secno>6.5.2 </span>The <code><a href=#h
became a <a href=#current-entry>current entry</a> in its <a href=#session-history>session history</a>.</p>

<p>Entries in the <a href=#joint-session-history>joint session history</a> are ordered chronologically by the time they
were added to their respective <a href=#session-history title="session history">session histories</a>. (Since all
these <a href=#browsing-context title="browsing context">browsing contexts</a> by definition share an <a href=#event-loop>event
loop</a>, there is always a well-defined sequential order in which their <a href=#session-history title="session
history">session histories</a> had their entries added.) Each entry has an index; the earliest
entry has index 0, and the subsequent entries are numbered with consecutively increasing integers
(1, 2, 3, etc).</p>
were added to their respective <a href=#session-history title="session history">session histories</a>. Each entry
has an index; the earliest entry has index 0, and the subsequent entries are numbered with
consecutively increasing integers (1, 2, 3, etc).</p>

<p class=note>Since each <code><a href=#document>Document</a></code> in a <a href=#browsing-context>browsing context</a> might have a
different <a href=#event-loop>event loop</a>, the actual state of the <a href=#joint-session-history>joint session history</a> can
be someone nebulous. For example, two sibling <code><a href=#the-iframe-element>iframe</a></code> elements could both <a href=#traverse-the-history title="traverse the history">traverse</a> from one unique origin to another at the same time,
so their precise order might not be well-defined; similarly, since they might only find out about
each other later, they might disagree about the length of the <a href=#joint-session-history>joint session
history</a>.</p>

<!--TOPIC:DOM APIs-->

<div class=impl>

<p>The <dfn id=dom-history-length title=dom-history-length><code>length</code></dfn> attribute of the
<code><a href=#history-0>History</a></code> interface must return the number of entries in the <a href=#joint-session-history>joint session
<code><a href=#history-0>History</a></code> interface must return the number of entries in the <a href=#top-level-browsing-context>top-level browsing context</a>'s <a href=#joint-session-history>joint session
history</a>.</p>

<p>The actual entries are not accessible from script.</p>
Expand All @@ -67239,50 +67244,81 @@ <h4 id=the-history-interface><span class=secno>6.5.2 </span>The <code><a href=#h

<!--TOPIC:HTML-->

<p>To <dfn id=traverse-the-history-by-a-delta>traverse the history by a delta</dfn> <var title="">delta</var>, the user agent must
<a href=#queue-a-task>queue a task</a> to run the following steps. The <a href=#task-source>task source</a> for the queued
task is the <a href=#history-traversal-task-source>history traversal task source</a>.</p>
<hr><p>Each <a href=#top-level-browsing-context>top-level browsing context</a> has a <dfn id=session-history-traversal-queue>session history traversal queue</dfn>,
initially empty, to which <a href=#concept-task title=concept-task>tasks</a> can be added.</p>

<p>Each <a href=#top-level-browsing-context>top-level browsing context</a>, when created, must asynchronously begin running
the following algorithm, known as the <dfn id=session-history-event-loop>session history event loop</dfn> for that
<a href=#top-level-browsing-context>top-level browsing context</a>:</p>

<ol><li><p>Wait until this <a href=#top-level-browsing-context>top-level browsing context</a>'s <a href=#session-history-traversal-queue>session history traversal
queue</a> is not empty.</li>

<li><p>Pull the first <a href=#concept-task title=concept-task>task</a> from this <a href=#top-level-browsing-context>top-level browsing
context</a>'s <a href=#session-history-traversal-queue>session history traversal queue</a>, and execute it.</li>

<li><p>Return to the first step of this algorithm.</p>

</ol><p>The <a href=#session-history-event-loop>session history event loop</a> helps coordinate cross-browsing-context transitions
of the <a href=#joint-session-history>joint session history</a>: since each <a href=#browsing-context>browsing context</a> might, at any
particular time, have a different <a href=#event-loop>event loop</a> (this can happen if the user agent has
more than one <a href=#event-loop>event loop</a> per <a href=#unit-of-related-browsing-contexts>unit of related browsing contexts</a>),
transitions would otherwise have to involve cross-event-loop synchronisation.</p>

<hr><p>To <dfn id=traverse-the-history-by-a-delta>traverse the history by a delta</dfn> <var title="">delta</var>, the user agent must
append a <a href=#concept-task title=concept-task>task</a> to this <a href=#top-level-browsing-context>top-level browsing context</a>'s
<a href=#session-history-traversal-queue>session history traversal queue</a>, the <a href=#concept-task title=concept-task>task</a>
consisting of running the following steps:</p>

<ol><li><p>Let <var title="">delta</var> be the argument to the method.</li>

<li><p>If the index of the <a href=#current-entry-of-the-joint-session-history>current entry of the joint session history</a> plus <var title="">delta</var> is less than zero or greater than or equal to the number of items in the
<a href=#joint-session-history>joint session history</a>, then abort these steps.</p>

<li><p>If the <code><a href=#document>Document</a></code>'s <a href=#unload-a-document>unload a document</a> algorithm is currently
running, abort these steps.</li>

<li><p>If there is an ongoing attempt to navigate the <a href=#browsing-context>browsing context</a> that has not
yet <a href=#concept-navigate-mature title=concept-navigate-mature>matured</a> (i.e. it has not passed the point of
making its <code><a href=#document>Document</a></code> the <a href=#active-document>active document</a>), then cancel that attempt to
navigate the <a href=#browsing-context>browsing context</a>.</li>

<li><p>Let <var title="">specified entry</var> be the entry in the <a href=#joint-session-history>joint session
history</a> whose index is the sum of <var title="">delta</var> and the index of the
<a href=#current-entry-of-the-joint-session-history>current entry of the joint session history</a>.</li>

<li><p>Let <var title="">specified browsing context</var> be the <a href=#browsing-context>browsing context</a> of
the <var title="">specified entry</var>.</li>

<li><p>If the <var title="">specified browsing context</var>'s <a href=#active-document>active document</a>'s
<a href=#unload-a-document>unload a document</a> algorithm is currently running, abort these steps.</li>

<li>

<p>If the <var title="">specified browsing context</var>'s <a href=#active-document>active document</a> is not
the same <code><a href=#document>Document</a></code> as the <code><a href=#document>Document</a></code> of the <var title="">specified
entry</var>, then run these substeps:</p>
<p><a href=#queue-a-task>Queue a task</a> that consists of running the following substeps. The relevant
<a href=#event-loop>event loop</a> is that of the <var title="">specified browsing context</var>'s
<a href=#active-document>active document</a>. The <a href=#task-source>task source</a> for the queued task is the
<a href=#history-traversal-task-source>history traversal task source</a>.</p>

<ol><li><p><a href=#fully-exit-fullscreen>Fully exit fullscreen</a>.</li>
<ol><li><p>If there is an ongoing attempt to navigate <var title="">specified browsing context</var>
that has not yet <a href=#concept-navigate-mature title=concept-navigate-mature>matured</a> (i.e. it has not passed the
point of making its <code><a href=#document>Document</a></code> the <a href=#active-document>active document</a>), then cancel that
attempt to navigate the <a href=#browsing-context>browsing context</a>.</li>

<li><p><a href=#prompt-to-unload-a-document title="prompt to unload a document">Prompt to unload</a> the <a href=#active-document>active
document</a> of the <var title="">specified browsing context</var>. If the user
<a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the document to be unloaded</a>, then abort these steps.</li>
<li>

<li><p><a href=#unload-a-document title="unload a document">Unload</a> the <a href=#active-document>active document</a> of the
<var title="">specified browsing context</var> with the <var title="">recycle</var> parameter
set to false.</li>
<p>If the <var title="">specified browsing context</var>'s <a href=#active-document>active document</a> is not
the same <code><a href=#document>Document</a></code> as the <code><a href=#document>Document</a></code> of the <var title="">specified
entry</var>, then run these substeps:</p>

</ol></li>
<ol><li><p><a href=#fully-exit-fullscreen>Fully exit fullscreen</a>.</li>

<li><p><a href=#prompt-to-unload-a-document title="prompt to unload a document">Prompt to unload</a> the <a href=#active-document>active
document</a> of the <var title="">specified browsing context</var>. If the user
<a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the document to be unloaded</a>, then abort these steps.</li>

<li><p><a href=#unload-a-document title="unload a document">Unload</a> the <a href=#active-document>active document</a> of the
<var title="">specified browsing context</var> with the <var title="">recycle</var> parameter
set to false.</li>

<li><p><a href=#traverse-the-history>Traverse the history</a> of the <var title="">specified browsing context</var> to
the <var title="">specified entry</var>.</p>
</ol></li>

<li><p><a href=#traverse-the-history>Traverse the history</a> of the <var title="">specified browsing context</var> to
the <var title="">specified entry</var>.</p>

</ol></li>

</ol><p>When the user navigates through a <a href=#browsing-context>browsing context</a>, e.g. using a browser's back
and forward buttons, the user agent must <a href=#traverse-the-history-by-a-delta>traverse the history by a delta</a> equivalent
Expand Down Expand Up @@ -71961,15 +71997,15 @@ <h5 id=definitions-1><span class=secno>7.1.4.1 </span>Definitions</h5>
<a href=#event-loop>event loop</a> coordinating its activities.</p>

<p>An <a href=#event-loop>event loop</a> has one or more <dfn id=task-queue title="task queue">task queues</dfn>. A
<a href=#task-queue>task queue</a> is an ordered list of <dfn id=concept-task title=concept-task>tasks</dfn>, which can
be:</p>
<a href=#task-queue>task queue</a> is an ordered list of <dfn id=concept-task title=concept-task>tasks</dfn>, which are
algorithms that are responsible for such work as:</p>

<dl><dt>Events</dt>

<dd>

<p>Asynchronously dispatching an <code><a href=#event>Event</a></code> object at a particular
<code><a href=#eventtarget>EventTarget</a></code> object is a task.</p>
<code><a href=#eventtarget>EventTarget</a></code> object is often done by a dedicated task.</p>

<p class=note>Not all events are dispatched using the <a href=#task-queue>task queue</a>, many are
dispatched synchronously during other tasks.</p>
Expand All @@ -71985,14 +72021,14 @@ <h5 id=definitions-1><span class=secno>7.1.4.1 </span>Definitions</h5>

<dt>Callbacks</dt>

<dd><p>Calling a callback asynchronously is a task.</dd>
<dd><p>Calling a callback asynchronously is often done by a dedicated task.</dd>


<dt>Using a resource</dt>

<dd><p>When an algorithm <a href=#fetch title=fetch>fetches</a> a resource, if the fetching occurs
asynchronously then the processing of the resource once some or all of the resource is available
is a task.</dd>
is performed by a task.</dd>


<dt>Reacting to DOM manipulation</dt>
Expand Down Expand Up @@ -95307,7 +95343,6 @@ <h4 id=quotes><span class=secno>14.3.6 </span>Quotes</h4>
:root:lang(nyn), :not(:lang(nyn)) &gt; :lang(nyn) { quotes: '\201c' '\201d' '\2018' '\2019' } /* &ldquo; &rdquo; &lsquo; &rsquor; */
:root:lang(pa), :not(:lang(pa)) &gt; :lang(pa) { quotes: '\0027' '\0027' '\0022' '\0022' } /* ' ' " " */
:root:lang(pl), :not(:lang(pl)) &gt; :lang(pl) { quotes: '\201e' '\201d' '\00ab' '\00bb' } /* &ldquor; &rdquo; &laquo; &raquo; */
:root:lang(prg), :not(:lang(prg)) &gt; :lang(prg) { quotes: '\201c' '\201d' '\2018' '\2019' } /* &ldquo; &rdquo; &lsquo; &rsquor; */
:root:lang(pt), :not(:lang(pt)) &gt; :lang(pt) { quotes: '\201c' '\201d' '\2018' '\2019' } /* &ldquo; &rdquo; &lsquo; &rsquor; */
:root:lang(pt-PT), :not(:lang(pt-PT)) &gt; :lang(pt-PT) { quotes: '\00ab' '\00bb' '\201c' '\201d' } /* &laquo; &raquo; &ldquo; &rdquo; */
:root:lang(rn), :not(:lang(rn)) &gt; :lang(rn) { quotes: '\201d' '\201d' '\2019' '\2019' } /* &rdquo; &rdquo; &rsquor; &rsquor; */
Expand Down

0 comments on commit 252bc97

Please sign in to comment.