[html5] r4376 - [e] (0) Explain pushState()'s title better.

whatwg at whatwg.org whatwg at whatwg.org
Mon Nov 23 17:02:03 PST 2009


Author: ianh
Date: 2009-11-23 17:01:59 -0800 (Mon, 23 Nov 2009)
New Revision: 4376

Modified:
   complete.html
   index
   source
Log:
[e] (0) Explain pushState()'s title better.

Modified: complete.html
===================================================================
--- complete.html	2009-11-13 01:45:00 UTC (rev 4375)
+++ complete.html	2009-11-24 01:01:59 UTC (rev 4376)
@@ -110,7 +110,7 @@
 
   <header class=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <hgroup><h1>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Draft Standard — 13 November 2009</h2>
+    <h2 class="no-num no-toc">Draft Standard — 24 November 2009</h2>
    </hgroup><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>-->
@@ -54832,6 +54832,14 @@
 
   </div>
 
+  <p class=note>Titles associated with <a href=#session-history-entry title="session history
+  entry">session history entries</a> need not have any relation
+  with the current <code><a href=#the-title-element-0>title</a></code> of the
+  <code>Document</code>. The title of a <a href=#session-history-entry>session history
+  entry</a> is intended to explain the state of the document at
+  that point, so that the user can navigate the document's
+  history.</p>
+
   <p>URLs without associated <a href=#state-object title="state object">state
   objects</a> are added to the session history as the user (or
   script) navigates from page to page.</p>
@@ -55190,8 +55198,39 @@
 
   </div>
 
+  <div class=example>
 
+   <p>Applications might not use the same title for a <a href=#session-history-entry>session
+   history entry</a> as the value of the document's
+   <code><a href=#the-title-element-0>title</a></code> element at that time. For example, here is a
+   simple page that shows a block in the <code><a href=#the-title-element-0>title</a></code> element.
+   Clearly, when navigating backwards to a previous state the user
+   does not go back in time, and therefore it would be inappropriate
+   to put the time in the session history title.</p>
 
+   <pre>&l;t!DOCTYPE HTML> 
+&l;tTITLE>Line&l;t/TITLE>
+&l;tSCRIPT>
+ setInterval(function () { document.title = 'Line - ' + new Date(); }, 1000);
+ var i = 1;
+ function inc() {
+   set(i+1);
+   history.pushState(i, 'Line - ' + i);
+ }
+ function set(newI) {
+   i = newI;
+   document.forms.F.I.value = newI;
+ }
+&l;t/SCRIPT>
+&l;tBODY ONPOPSTATE="recover(event.state)">
+&l;tFORM NAME=F>
+State: &l;tOUTPUT NAME=I>1&l;t/OUTPUT> &l;tINPUT VALUE="Increment" TYPE=BUTTON ONCLICK="inc()">
+&l;t/FORM></pre>
+
+  </div>
+
+
+
   <h4 id=activating-state-object-entries><span class=secno>6.10.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4>
 
   <div class=impl>

Modified: index
===================================================================
--- index	2009-11-13 01:45:00 UTC (rev 4375)
+++ index	2009-11-24 01:01:59 UTC (rev 4376)
@@ -111,7 +111,7 @@
 
   <header class=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <hgroup><h1>HTML5</h1>
-    <h2 class="no-num no-toc">Draft Standard — 13 November 2009</h2>
+    <h2 class="no-num no-toc">Draft Standard — 24 November 2009</h2>
    </hgroup><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>-->
@@ -51998,6 +51998,14 @@
 
   </div>
 
+  <p class=note>Titles associated with <a href=#session-history-entry title="session history
+  entry">session history entries</a> need not have any relation
+  with the current <code><a href=#the-title-element-0>title</a></code> of the
+  <code>Document</code>. The title of a <a href=#session-history-entry>session history
+  entry</a> is intended to explain the state of the document at
+  that point, so that the user can navigate the document's
+  history.</p>
+
   <p>URLs without associated <a href=#state-object title="state object">state
   objects</a> are added to the session history as the user (or
   script) navigates from page to page.</p>
@@ -52356,8 +52364,39 @@
 
   </div>
 
+  <div class=example>
 
+   <p>Applications might not use the same title for a <a href=#session-history-entry>session
+   history entry</a> as the value of the document's
+   <code><a href=#the-title-element-0>title</a></code> element at that time. For example, here is a
+   simple page that shows a block in the <code><a href=#the-title-element-0>title</a></code> element.
+   Clearly, when navigating backwards to a previous state the user
+   does not go back in time, and therefore it would be inappropriate
+   to put the time in the session history title.</p>
 
+   <pre>&l;t!DOCTYPE HTML> 
+&l;tTITLE>Line&l;t/TITLE>
+&l;tSCRIPT>
+ setInterval(function () { document.title = 'Line - ' + new Date(); }, 1000);
+ var i = 1;
+ function inc() {
+   set(i+1);
+   history.pushState(i, 'Line - ' + i);
+ }
+ function set(newI) {
+   i = newI;
+   document.forms.F.I.value = newI;
+ }
+&l;t/SCRIPT>
+&l;tBODY ONPOPSTATE="recover(event.state)">
+&l;tFORM NAME=F>
+State: &l;tOUTPUT NAME=I>1&l;t/OUTPUT> &l;tINPUT VALUE="Increment" TYPE=BUTTON ONCLICK="inc()">
+&l;t/FORM></pre>
+
+  </div>
+
+
+
   <h4 id=activating-state-object-entries><span class=secno>6.10.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4>
 
   <div class=impl>

Modified: source
===================================================================
--- source	2009-11-13 01:45:00 UTC (rev 4375)
+++ source	2009-11-24 01:01:59 UTC (rev 4376)
@@ -61867,6 +61867,14 @@
 
   </div>
 
+  <p class="note">Titles associated with <span title="session history
+  entry">session history entries</span> need not have any relation
+  with the current <code>title</code> of the
+  <code>Document</code>. The title of a <span>session history
+  entry</span> is intended to explain the state of the document at
+  that point, so that the user can navigate the document's
+  history.</p>
+
   <p>URLs without associated <span title="state object">state
   objects</span> are added to the session history as the user (or
   script) navigates from page to page.</p>
@@ -62284,8 +62292,39 @@
 
   </div>
 
+  <div class="example">
 
+   <p>Applications might not use the same title for a <span>session
+   history entry</span> as the value of the document's
+   <code>title</code> element at that time. For example, here is a
+   simple page that shows a block in the <code>title</code> element.
+   Clearly, when navigating backwards to a previous state the user
+   does not go back in time, and therefore it would be inappropriate
+   to put the time in the session history title.</p>
 
+   <pre>&l;t!DOCTYPE HTML> 
+&l;tTITLE>Line&l;t/TITLE>
+&l;tSCRIPT>
+ setInterval(function () { document.title = 'Line - ' + new Date(); }, 1000);
+ var i = 1;
+ function inc() {
+   set(i+1);
+   history.pushState(i, 'Line - ' + i);
+ }
+ function set(newI) {
+   i = newI;
+   document.forms.F.I.value = newI;
+ }
+&l;t/SCRIPT>
+&l;tBODY ONPOPSTATE="recover(event.state)">
+&l;tFORM NAME=F>
+State: &l;tOUTPUT NAME=I>1&l;t/OUTPUT> &l;tINPUT VALUE="Increment" TYPE=BUTTON ONCLICK="inc()">
+&l;t/FORM></pre>
+
+  </div>
+
+
+
   <h4><dfn title="activate the state object">Activating state object entries</dfn></h4>
 
   <div class="impl">




More information about the Commit-Watchers mailing list