Skip to content

Commit

Permalink
[e] (0) Explain pushState()'s title better.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@4376 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 24, 2009
1 parent 15cae6c commit 06b8168
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 2 deletions.
41 changes: 40 additions & 1 deletion complete.html
Expand Up @@ -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 &mdash; 13 November 2009</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 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>-->
Expand Down Expand Up @@ -54832,6 +54832,14 @@ <h4 id=the-session-history-of-browsing-contexts><span class=secno>6.10.1 </span>

</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>
Expand Down Expand Up @@ -55190,6 +55198,37 @@ <h4 id=the-history-interface><span class=secno>6.10.2 </span>The <code><a href=#

</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>&amp;l;t!DOCTYPE HTML&gt;
&amp;l;tTITLE&gt;Line&amp;l;t/TITLE&gt;
&amp;l;tSCRIPT&gt;
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;
}
&amp;l;t/SCRIPT&gt;
&amp;l;tBODY ONPOPSTATE="recover(event.state)"&gt;
&amp;l;tFORM NAME=F&gt;
State: &amp;l;tOUTPUT NAME=I&gt;1&amp;l;t/OUTPUT&gt; &amp;l;tINPUT VALUE="Increment" TYPE=BUTTON ONCLICK="inc()"&gt;
&amp;l;t/FORM&gt;</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>
Expand Down
41 changes: 40 additions & 1 deletion index
Expand Up @@ -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 &mdash; 13 November 2009</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 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>-->
Expand Down Expand Up @@ -51998,6 +51998,14 @@ NETWORK:

</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>
Expand Down Expand Up @@ -52356,6 +52364,37 @@ NETWORK:

</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>&amp;l;t!DOCTYPE HTML&gt;
&amp;l;tTITLE&gt;Line&amp;l;t/TITLE&gt;
&amp;l;tSCRIPT&gt;
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;
}
&amp;l;t/SCRIPT&gt;
&amp;l;tBODY ONPOPSTATE="recover(event.state)"&gt;
&amp;l;tFORM NAME=F&gt;
State: &amp;l;tOUTPUT NAME=I&gt;1&amp;l;t/OUTPUT&gt; &amp;l;tINPUT VALUE="Increment" TYPE=BUTTON ONCLICK="inc()"&gt;
&amp;l;t/FORM&gt;</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>
Expand Down
39 changes: 39 additions & 0 deletions source
Expand Up @@ -61867,6 +61867,14 @@ NETWORK:

</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>
Expand Down Expand Up @@ -62284,6 +62292,37 @@ NETWORK:

</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>
Expand Down

0 comments on commit 06b8168

Please sign in to comment.