[html5] r8199 - [giow] (3) Session history traversal in a multi-process world. I have no idea wh [...]
whatwg at whatwg.org
whatwg at whatwg.org
Wed Sep 25 13:51:21 PDT 2013
Author: ianh
Date: 2013-09-25 13:51:16 -0700 (Wed, 25 Sep 2013)
New Revision: 8199
Modified:
complete.html
index
source
Log:
[giow] (3) Session history traversal in a multi-process world. I have no idea what I'm doing.
Affected topics: DOM APIs, HTML
Modified: complete.html
===================================================================
--- complete.html 2013-09-24 22:31:27 UTC (rev 8198)
+++ complete.html 2013-09-25 20:51:16 UTC (rev 8199)
@@ -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 — Last Updated 24 September 2013</h2>
+ <h2 class="no-num no-toc">Living Standard — 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>
@@ -66966,7 +66966,7 @@
<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>
@@ -67115,6 +67115,7 @@
</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>
@@ -67192,10 +67193,10 @@
</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>
@@ -67204,19 +67205,23 @@
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>
@@ -67239,23 +67244,37 @@
<!--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>
@@ -67263,27 +67282,44 @@
<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><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>
+
+ </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>
- <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><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
to the action specified by the user.</p>
@@ -71961,15 +71997,15 @@
<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>
@@ -71985,14 +72021,14 @@
<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>
@@ -95307,7 +95343,6 @@
:root:lang(nyn), :not(:lang(nyn)) > :lang(nyn) { quotes: '\201c' '\201d' '\2018' '\2019' } /* “ ” ‘ ’ */
:root:lang(pa), :not(:lang(pa)) > :lang(pa) { quotes: '\0027' '\0027' '\0022' '\0022' } /* ' ' " " */
:root:lang(pl), :not(:lang(pl)) > :lang(pl) { quotes: '\201e' '\201d' '\00ab' '\00bb' } /* „ ” « » */
-:root:lang(prg), :not(:lang(prg)) > :lang(prg) { quotes: '\201c' '\201d' '\2018' '\2019' } /* “ ” ‘ ’ */
:root:lang(pt), :not(:lang(pt)) > :lang(pt) { quotes: '\201c' '\201d' '\2018' '\2019' } /* “ ” ‘ ’ */
:root:lang(pt-PT), :not(:lang(pt-PT)) > :lang(pt-PT) { quotes: '\00ab' '\00bb' '\201c' '\201d' } /* « » “ ” */
:root:lang(rn), :not(:lang(rn)) > :lang(rn) { quotes: '\201d' '\201d' '\2019' '\2019' } /* ” ” ’ ’ */
Modified: index
===================================================================
--- index 2013-09-24 22:31:27 UTC (rev 8198)
+++ index 2013-09-25 20:51:16 UTC (rev 8199)
@@ -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 — Last Updated 24 September 2013</h2>
+ <h2 class="no-num no-toc">Living Standard — 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>
@@ -66966,7 +66966,7 @@
<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>
@@ -67115,6 +67115,7 @@
</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>
@@ -67192,10 +67193,10 @@
</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>
@@ -67204,19 +67205,23 @@
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>
@@ -67239,23 +67244,37 @@
<!--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>
@@ -67263,27 +67282,44 @@
<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><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>
+
+ </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>
- <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><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
to the action specified by the user.</p>
@@ -71961,15 +71997,15 @@
<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>
@@ -71985,14 +72021,14 @@
<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>
@@ -95307,7 +95343,6 @@
:root:lang(nyn), :not(:lang(nyn)) > :lang(nyn) { quotes: '\201c' '\201d' '\2018' '\2019' } /* “ ” ‘ ’ */
:root:lang(pa), :not(:lang(pa)) > :lang(pa) { quotes: '\0027' '\0027' '\0022' '\0022' } /* ' ' " " */
:root:lang(pl), :not(:lang(pl)) > :lang(pl) { quotes: '\201e' '\201d' '\00ab' '\00bb' } /* „ ” « » */
-:root:lang(prg), :not(:lang(prg)) > :lang(prg) { quotes: '\201c' '\201d' '\2018' '\2019' } /* “ ” ‘ ’ */
:root:lang(pt), :not(:lang(pt)) > :lang(pt) { quotes: '\201c' '\201d' '\2018' '\2019' } /* “ ” ‘ ’ */
:root:lang(pt-PT), :not(:lang(pt-PT)) > :lang(pt-PT) { quotes: '\00ab' '\00bb' '\201c' '\201d' } /* « » “ ” */
:root:lang(rn), :not(:lang(rn)) > :lang(rn) { quotes: '\201d' '\201d' '\2019' '\2019' } /* ” ” ’ ’ */
Modified: source
===================================================================
--- source 2013-09-24 22:31:27 UTC (rev 8198)
+++ source 2013-09-25 20:51:16 UTC (rev 8199)
@@ -74750,6 +74750,7 @@
+<!--CLEANUP-->
<h3 id="history">Session history and navigation</h3>
<h4>The session history of browsing contexts</h4>
@@ -74904,6 +74905,7 @@
</div>
+
<!--TOPIC:DOM APIs-->
<h4>The <code>History</code> interface</h4>
@@ -74987,10 +74989,10 @@
<!--TOPIC:HTML-->
- <p>The <dfn>joint session history</dfn> of a <code>History</code> object is the union of all the
+ <p>The <dfn>joint session history</dfn> of a <span>top-level browsing context</span> is the union of all the
<span title="session history">session histories</span> of all <span title="browsing
context">browsing contexts</span> of all the <span>fully active</span> <code>Document</code>
- objects that share the <code>History</code> object's <span>top-level browsing context</span>, with
+ objects that share that <span>top-level browsing context</span>, with
all the entries that are <span title="current entry">current entries</span> in their respective
<span title="session history">session histories</span> removed except for the <span>current entry
of the joint session history</span>.</p>
@@ -74999,19 +75001,24 @@
became a <span>current entry</span> in its <span>session history</span>.</p>
<p>Entries in the <span>joint session history</span> are ordered chronologically by the time they
- were added to their respective <span title="session history">session histories</span>. (Since all
- these <span title="browsing context">browsing contexts</span> by definition share an <span>event
- loop</span>, there is always a well-defined sequential order in which their <span title="session
- history">session histories</span> 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 <span title="session history">session histories</span>. 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>Document</code> in a <span>browsing context</span> might have a
+ different <span>event loop</span>, the actual state of the <span>joint session history</span> can
+ be someone nebulous. For example, two sibling <code>iframe</code> elements could both <span
+ title="traverse the history">traverse</span> 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 <span>joint session
+ history</span>.</p>
+
<!--TOPIC:DOM APIs-->
<div class="impl">
<p>The <dfn title="dom-history-length"><code>length</code></dfn> attribute of the
- <code>History</code> interface must return the number of entries in the <span>joint session
+ <code>History</code> interface must return the number of entries in the <span>top-level browsing context</span>'s <span>joint session
history</span>.</p>
<p>The actual entries are not accessible from script.</p>
@@ -75034,9 +75041,39 @@
<!--TOPIC:HTML-->
+ <hr>
+
+ <p>Each <span>top-level browsing context</span> has a <dfn>session history traversal queue</dfn>,
+ initially empty, to which <span title="concept-task">tasks</span> can be added.</p>
+
+ <p>Each <span>top-level browsing context</span>, when created, must asynchronously begin running
+ the following algorithm, known as the <dfn>session history event loop</dfn> for that
+ <span>top-level browsing context</span>:</p>
+
+ <ol>
+
+ <li><p>Wait until this <span>top-level browsing context</span>'s <span>session history traversal
+ queue</span> is not empty.</p></li>
+
+ <li><p>Pull the first <span title="concept-task">task</span> from this <span>top-level browsing
+ context</span>'s <span>session history traversal queue</span>, and execute it.</p></li>
+
+ <li><p>Return to the first step of this algorithm.</p>
+
+ </ol>
+
+ <p>The <span>session history event loop</span> helps coordinate cross-browsing-context transitions
+ of the <span>joint session history</span>: since each <span>browsing context</span> might, at any
+ particular time, have a different <span>event loop</span> (this can happen if the user agent has
+ more than one <span>event loop</span> per <span>unit of related browsing contexts</span>),
+ transitions would otherwise have to involve cross-event-loop synchronisation.</p>
+
+ <hr>
+
<p>To <dfn>traverse the history by a delta</dfn> <var title="">delta</var>, the user agent must
- <span>queue a task</span> to run the following steps. The <span>task source</span> for the queued
- task is the <span>history traversal task source</span>.</p>
+ append a <span title="concept-task">task</span> to this <span>top-level browsing context</span>'s
+ <span>session history traversal queue</span>, the <span title="concept-task">task</span>
+ consisting of running the following steps:</p>
<ol>
@@ -75046,14 +75083,6 @@
title="">delta</var> is less than zero or greater than or equal to the number of items in the
<span>joint session history</span>, then abort these steps.</p>
- <li><p>If the <code>Document</code>'s <span>unload a document</span> algorithm is currently
- running, abort these steps.</p></li>
-
- <li><p>If there is an ongoing attempt to navigate the <span>browsing context</span> that has not
- yet <span title="concept-navigate-mature">matured</span> (i.e. it has not passed the point of
- making its <code>Document</code> the <span>active document</span>), then cancel that attempt to
- navigate the <span>browsing context</span>.</p></li>
-
<li><p>Let <var title="">specified entry</var> be the entry in the <span>joint session
history</span> whose index is the sum of <var title="">delta</var> and the index of the
<span>current entry of the joint session history</span>.</p></li>
@@ -75061,31 +75090,52 @@
<li><p>Let <var title="">specified browsing context</var> be the <span>browsing context</span> of
the <var title="">specified entry</var>.</p></li>
+ <li><p>If the <var title="">specified browsing context</var>'s <span>active document</span>'s
+ <span>unload a document</span> algorithm is currently running, abort these steps.</p></li>
+
<li>
- <p>If the <var title="">specified browsing context</var>'s <span>active document</span> is not
- the same <code>Document</code> as the <code>Document</code> of the <var title="">specified
- entry</var>, then run these substeps:</p>
+ <p><span>Queue a task</span> that consists of running the following substeps. The relevant
+ <span>event loop</span> is that of the <var title="">specified browsing context</var>'s
+ <span>active document</span>. The <span>task source</span> for the queued task is the
+ <span>history traversal task source</span>.</p>
<ol>
- <li><p><span>Fully exit fullscreen</span>.</p></li>
+ <li><p>If there is an ongoing attempt to navigate <var title="">specified browsing context</var>
+ that has not yet <span title="concept-navigate-mature">matured</span> (i.e. it has not passed the
+ point of making its <code>Document</code> the <span>active document</span>), then cancel that
+ attempt to navigate the <span>browsing context</span>.</p></li>
- <li><p><span title="prompt to unload a document">Prompt to unload</span> the <span>active
- document</span> of the <var title="">specified browsing context</var>. If the user
- <span>refused to allow the document to be unloaded</span>, then abort these steps.</p></li>
+ <li>
- <li><p><span title="unload a document">Unload</span> the <span>active document</span> of the
- <var title="">specified browsing context</var> with the <var title="">recycle</var> parameter
- set to false.</p></li>
+ <p>If the <var title="">specified browsing context</var>'s <span>active document</span> is not
+ the same <code>Document</code> as the <code>Document</code> of the <var title="">specified
+ entry</var>, then run these substeps:</p>
+ <ol>
+
+ <li><p><span>Fully exit fullscreen</span>.</p></li>
+
+ <li><p><span title="prompt to unload a document">Prompt to unload</span> the <span>active
+ document</span> of the <var title="">specified browsing context</var>. If the user
+ <span>refused to allow the document to be unloaded</span>, then abort these steps.</p></li>
+
+ <li><p><span title="unload a document">Unload</span> the <span>active document</span> of the
+ <var title="">specified browsing context</var> with the <var title="">recycle</var> parameter
+ set to false.</p></li>
+
+ </ol>
+
+ </li>
+
+ <li><p><span>Traverse the history</span> of the <var title="">specified browsing context</var> to
+ the <var title="">specified entry</var>.</p>
+
</ol>
</li>
- <li><p><span>Traverse the history</span> of the <var title="">specified browsing context</var> to
- the <var title="">specified entry</var>.</p>
-
</ol>
<p>When the user navigates through a <span>browsing context</span>, e.g. using a browser's back
@@ -80484,8 +80534,8 @@
<span>event loop</span> coordinating its activities.</p>
<p>An <span>event loop</span> has one or more <dfn title="task queue">task queues</dfn>. A
- <span>task queue</span> is an ordered list of <dfn title="concept-task">tasks</dfn>, which can
- be:</p>
+ <span>task queue</span> is an ordered list of <dfn title="concept-task">tasks</dfn>, which are
+ algorithms that are responsible for such work as:</p>
<dl>
@@ -80494,7 +80544,7 @@
<dd>
<p>Asynchronously dispatching an <code>Event</code> object at a particular
- <code>EventTarget</code> object is a task.</p>
+ <code>EventTarget</code> object is often done by a dedicated task.</p>
<p class="note">Not all events are dispatched using the <span>task queue</span>, many are
dispatched synchronously during other tasks.</p>
@@ -80510,14 +80560,14 @@
<dt>Callbacks</dt>
- <dd><p>Calling a callback asynchronously is a task.</p></dd>
+ <dd><p>Calling a callback asynchronously is often done by a dedicated task.</p></dd>
<dt>Using a resource</dt>
<dd><p>When an algorithm <span title="fetch">fetches</span> 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.</p></dd>
+ is performed by a task.</p></dd>
<dt>Reacting to DOM manipulation</dt>
More information about the Commit-Watchers
mailing list