[html5] r3359 - [giow] (2) Define how history.back() works in a manner compatible with what IE does.

whatwg at whatwg.org whatwg at whatwg.org
Mon Jul 6 17:32:45 PDT 2009


Author: ianh
Date: 2009-07-06 17:32:44 -0700 (Mon, 06 Jul 2009)
New Revision: 3359

Modified:
   index
   source
Log:
[giow] (2) Define how history.back() works in a manner compatible with what IE does.

Modified: index
===================================================================
--- index	2009-07-06 10:22:17 UTC (rev 3358)
+++ index	2009-07-07 00:32:44 UTC (rev 3359)
@@ -67,7 +67,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML 5</h1>
-   <h2 class="no-num no-toc" id=draft-standard-—-date:-01-jan-1901>Draft Standard — 6 July 2009</h2>
+   <h2 class="no-num no-toc" id=draft-standard-—-date:-01-jan-1901>Draft Standard — 7 July 2009</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -51214,7 +51214,7 @@
 
    <dd>
 
-    <p>Returns the number of entries in the session history.</p>
+    <p>Returns the number of entries in the <a href=#joint-session-history>joint session history</a>.</p>
 
    </dd>
 
@@ -51222,7 +51222,7 @@
 
    <dd>
 
-    <p>Goes back or forward the specified number of steps in the history.</p>
+    <p>Goes back or forward the specified number of steps in the <a href=#joint-session-history>joint session history</a>.</p>
 
     <p>A zero delta will reload the current page.</p>
 
@@ -51234,7 +51234,7 @@
 
    <dd>
 
-    <p>Goes back one step in the history.</p>
+    <p>Goes back one step in the <a href=#joint-session-history>joint session history</a>.</p>
 
     <p>If there is no previous page, does nothing.</p>
 
@@ -51244,7 +51244,7 @@
 
    <dd>
 
-    <p>Goes forward one step in the history.</p>
+    <p>Goes forward one step in the <a href=#joint-session-history>joint session history</a>.</p>
 
     <p>If there is no next page, does nothing.</p>
 
@@ -51266,33 +51266,62 @@
 
    </dd>
 
-  </dl><div class=impl>
+  </dl><p>The <dfn id=joint-session-history>joint session history</dfn> of a <code><a href=#history-1>History</a></code>
+  object 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>Document</code> objects that share the <code><a href=#history-1>History</a></code>
+  object's <a href=#top-level-browsing-context>top-level browsing context</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>
+
+  <p>The <dfn id=current-entry-of-the-joint-session-history>current entry of the joint session history</dfn> is the
+  entry that was the most recently became a <a href=#current-entry>current entry</a>
+  in its <a href=#session-history>session history</a>.</p>
+
+  <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-1>History</a></code> interface must return the
-  number of entries in this <a href=#session-history>session history</a>.</p>
+  number of entries in the <a href=#joint-session-history>joint session history</a>.</p>
 
   <p>The actual entries are not accessible from script.</p>
 
-  <p>The <dfn id=dom-history-go title=dom-history-go><code>go(<var title="">delta</var>)</code></dfn> method causes the UA to move the
-  number of steps specified by <var title="">delta</var> in the
-  session history.</p>
+  <p>The <dfn id=dom-history-go title=dom-history-go><code>go(<var title="">delta</var>)</code></dfn> method causes the UA to run the
+  following steps:</p>
 
-  <p>If the <var title="">delta</var> is zero, or if the argument is
-  omitted, then the user agent must act as if the <code title=dom-location-reload><a href=#dom-location-reload>location.reload()</a></code> method was
-  called instead.</p>
+  <ol><li><p>If the argument to the method was omitted or has the value
+   zero, then act as if the <code title=dom-location-reload><a href=#dom-location-reload>location.reload()</a></code> method was
+   called instead, and abort these steps.</p>
 
-  <p>Otherwise, if the index of the <a href=#current-entry>current entry</a> plus
-  <var title="">delta</var> is less than zero or greater than or equal
-  to the <a href=#dom-history-length title=dom-history-length>number of items in the
-  session history</a>, then the user agent must do nothing.</p>
+   <li><p>Let <var title="">delta</var> be the argument to the
+   method.</li>
 
-  <p>Otherwise, the user agent must cause the current <a href=#browsing-context>browsing
-  context</a> to <a href=#traverse-the-history>traverse the history</a> to the specified
-  entry. The <i>specified entry</i> is the one whose index equals the
-  index of the <a href=#current-entry>current entry</a> plus <var title="">delta</var>.</p>
+   <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 the user agent must do nothing.</p>
 
-  <p>When the user navigates through a <a href=#browsing-context>browsing context</a>,
+   <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><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
   translate this action into the equivalent invocations of the <code title=dom-history-go><a href=#dom-history-go>history.go(<var title="">delta</var>)</a></code>
   method on the various affected <code title=dom-window><a href=#dom-window>window</a></code> objects.</p>
@@ -51307,7 +51336,7 @@
     <td>Must do the same as <code title=dom-history-go><a href=#dom-history-go>go(-1)</a></code></td>
    <tr><td><dfn id=dom-history-forward title=dom-history-forward><code>forward()</code></dfn></td>
     <td>Must do the same as <code title=dom-history-go><a href=#dom-history-go>go(1)</a></code></td>
-   </table><p>The <dfn id=dom-history-pushstate title=dom-history-pushState><code>pushState(<var title="">data</var>, <var title="">title</var>, <var title="">url</var>)</code></dfn> method adds a state object to the
+   </table><hr><p>The <dfn id=dom-history-pushstate title=dom-history-pushState><code>pushState(<var title="">data</var>, <var title="">title</var>, <var title="">url</var>)</code></dfn> method adds a state object to the
   history.</p>
 
   <p>When this method is invoked, the user agent must run the following steps:</p>

Modified: source
===================================================================
--- source	2009-07-06 10:22:17 UTC (rev 3358)
+++ source	2009-07-07 00:32:44 UTC (rev 3359)
@@ -58378,7 +58378,7 @@
 
    <dd>
 
-    <p>Returns the number of entries in the session history.</p>
+    <p>Returns the number of entries in the <span>joint session history</span>.</p>
 
    </dd>
 
@@ -58386,7 +58386,7 @@
 
    <dd>
 
-    <p>Goes back or forward the specified number of steps in the history.</p>
+    <p>Goes back or forward the specified number of steps in the <span>joint session history</span>.</p>
 
     <p>A zero delta will reload the current page.</p>
 
@@ -58398,7 +58398,7 @@
 
    <dd>
 
-    <p>Goes back one step in the history.</p>
+    <p>Goes back one step in the <span>joint session history</span>.</p>
 
     <p>If there is no previous page, does nothing.</p>
 
@@ -58408,7 +58408,7 @@
 
    <dd>
 
-    <p>Goes forward one step in the history.</p>
+    <p>Goes forward one step in the <span>joint session history</span>.</p>
 
     <p>If there is no next page, does nothing.</p>
 
@@ -58432,35 +58432,70 @@
 
   </dl>
 
+  <p>The <dfn>joint session history</dfn> of a <code>History</code>
+  object 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>.</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>
+
+  <p>The <dfn>current entry of the joint session history</dfn> is the
+  entry that was the most recently became a <span>current entry</span>
+  in its <span>session history</span>.</p>
+
   <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 this <span>session history</span>.</p>
+  number of entries in the <span>joint session history</span>.</p>
 
   <p>The actual entries are not accessible from script.</p>
 
   <p>The <dfn title="dom-history-go"><code>go(<var
-  title="">delta</var>)</code></dfn> method causes the UA to move the
-  number of steps specified by <var title="">delta</var> in the
-  session history.</p>
+  title="">delta</var>)</code></dfn> method causes the UA to run the
+  following steps:</p>
 
-  <p>If the <var title="">delta</var> is zero, or if the argument is
-  omitted, then the user agent must act as if the <code
-  title="dom-location-reload">location.reload()</code> method was
-  called instead.</p>
+  <ol>
 
-  <p>Otherwise, if the index of the <span>current entry</span> plus
-  <var title="">delta</var> is less than zero or greater than or equal
-  to the <span title="dom-history-length">number of items in the
-  session history</span>, then the user agent must do nothing.</p>
+   <li><p>If the argument to the method was omitted or has the value
+   zero, then act as if the <code
+   title="dom-location-reload">location.reload()</code> method was
+   called instead, and abort these steps.</p>
 
-  <p>Otherwise, the user agent must cause the current <span>browsing
-  context</span> to <span>traverse the history</span> to the specified
-  entry. The <i>specified entry</i> is the one whose index equals the
-  index of the <span>current entry</span> plus <var
-  title="">delta</var>.</p>
+   <li><p>Let <var title="">delta</var> be the argument to the
+   method.</p></li>
 
+   <li><p>If the index of the <span>current entry of the joint session
+   history</span> plus <var 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 the user agent must do nothing.</p>
+
+   <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>
+
+   <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><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 and forward buttons, the user agent must
   translate this action into the equivalent invocations of the <code
@@ -58487,6 +58522,8 @@
    </tr>
   </table>
 
+  <hr>
+
   <p>The <dfn title="dom-history-pushState"><code>pushState(<var
   title="">data</var>, <var title="">title</var>, <var
   title="">url</var>)</code></dfn> method adds a state object to the




More information about the Commit-Watchers mailing list