- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 29 Sep 2009 00:17:12 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/spec-author-view In directory hutz:/tmp/cvs-serv14695 Modified Files: Overview.html acknowledgements.html browsers.html comms.html dom.html editing.html embedded-content-0.html forms.html history.html iana-considerations.html index.html infrastructure.html interactive-elements.html introduction.html microdata.html named-character-references.html obsolete.html offline.html references.html semantics.html spec.html syntax.html tabular-data.html text-level-semantics.html the-canvas-element.html the-xhtml-syntax.html video.html Log Message: Add an example for pushState(). (whatwg r4012) [updated by splitter] Index: infrastructure.html =================================================================== RCS file: /sources/public/html5/spec-author-view/infrastructure.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- infrastructure.html 28 Sep 2009 23:47:09 -0000 1.252 +++ infrastructure.html 29 Sep 2009 00:17:09 -0000 1.253 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="introduction.html">← 1 Introduction</a> – <a href="Overview.html#contents">Table of contents</a> – Index: text-level-semantics.html =================================================================== RCS file: /sources/public/html5/spec-author-view/text-level-semantics.html,v retrieving revision 1.250 retrieving revision 1.251 diff -u -d -r1.250 -r1.251 --- text-level-semantics.html 28 Sep 2009 23:47:10 -0000 1.250 +++ text-level-semantics.html 29 Sep 2009 00:17:10 -0000 1.251 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="semantics.html">← 4 The elements of HTML</a> – <a href="Overview.html#contents">Table of contents</a> – Index: history.html =================================================================== RCS file: /sources/public/html5/spec-author-view/history.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- history.html 28 Sep 2009 23:47:09 -0000 1.252 +++ history.html 29 Sep 2009 00:17:09 -0000 1.253 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="offline.html">← 6.7 Offline Web applications</a> – <a href="Overview.html#contents">Table of contents</a> – @@ -342,7 +342,71 @@ 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><!-- XXX add a pushState() example here, for bug 7621 --><h4 id="activating-state-object-entries"><span class="secno">6.8.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4><pre class="idl">interface <dfn id="popstateevent">PopStateEvent</dfn> : Event { + in its <a href="#session-history">session history</a>.</p><div class="example"> + + <p>Consider a game where the user can navigate along a line, such + that the user is always at some coordinate, and such that the user + can bookmark the page corresponding to a particular coordinate, to + return to it later.</p> + + <p>A static page implementing the x=5 position in such a game could + look like the following:</p> + + <pre><!DOCTYPE HTML> +<!-- this is http://example.com/line?x=5 --> +<title>Line Game - 5</title> +<p>You are at coordinate 5 on the line.</p> +<p> + <a href="?x=6">Advance to 6</a> or + <a href="?x=4">retreat to 4</a>? +</p></pre> + + <p>The problem with such a system is that each time the user + clicks, the whole page has to be reloaded. Here instead is another + way of doing it, using script:</p> + + <pre><!DOCTYPE HTML> +<!-- this starts off as http://example.com/line?x=5 --> +<title>Line Game - 5</title> +<p>You are at coordinate <span id="coord">5</span> on the line.</p> +<p> + <a href="?x=6" onclick="go(1)">Advance to 6</a> or + <a href="?x=4" onclick="go(-1)">retreat to 4</a>? +</p> +<script> + var currentPage = 5; // prefilled by server + function go(d) { + history.pushState(currentPage, 'Line Game - ' + currentPage, '?x=' + currentPage); + setupPage(currentPage + d); + } + onpopstate = function(event) { + setupPage(event.state); + } + function setupPage(page) { + currentPage = page; + document.title = 'Line Game - ' + currentPage; + document.getElementById('coord').textContent = currentPage; + document.links[0].href = '?x=' + (currentPage+1); + document.links[0].textContent = 'Advance to ' + (currentPage+1); + document.links[1].href = '?x=' + (currentPage-1); + document.links[1].textContent = 'retreat to ' + (currentPage-1); + } +</script></pre> + + <p>In systems without script, this still works like the previous + example. However, users that <em>do</em> have script support can + now navigate much faster, since there is no network access for the + same experience. Furthermore, contrary to the experience the user + would have with just a naïve script-based approach, + bookmarking and navigating the session history still work.</p> + + <p>In the example above, the <var title="">data</var> argument to + the <code title="dom-history-pushState"><a href="#dom-history-pushstate">pushState()</a></code> method + is the same information as would be sent to the server, but in a + more convenient form, so that the script doesn't have to parse the + URL each time the user navigates.</p> + + </div><h4 id="activating-state-object-entries"><span class="secno">6.8.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4><pre class="idl">interface <dfn id="popstateevent">PopStateEvent</dfn> : Event { readonly attribute any <a href="#dom-popstateevent-state" title="dom-PopStateEvent-state">state</a>; void <a href="#dom-popstateevent-initpopstateevent" title="dom-PopStateEvent-initPopStateEvent">initPopStateEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg); void <a href="#dom-popstateevent-initpopstateeventns" title="dom-PopStateEvent-initPopStateEventNS">initPopStateEventNS</a>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg); Index: tabular-data.html =================================================================== RCS file: /sources/public/html5/spec-author-view/tabular-data.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- tabular-data.html 28 Sep 2009 23:47:10 -0000 1.251 +++ tabular-data.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="the-canvas-element.html">← 4.8.11 The canvas element</a> – <a href="Overview.html#contents">Table of contents</a> – Index: microdata.html =================================================================== RCS file: /sources/public/html5/spec-author-view/microdata.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- microdata.html 28 Sep 2009 23:47:09 -0000 1.251 +++ microdata.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="interactive-elements.html">← 4.11 Interactive elements</a> – <a href="Overview.html#contents">Table of contents</a> – Index: Overview.html =================================================================== RCS file: /sources/public/html5/spec-author-view/Overview.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- Overview.html 28 Sep 2009 23:47:09 -0000 1.251 +++ Overview.html 29 Sep 2009 00:17:08 -0000 1.252 @@ -217,7 +217,7 @@ <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> <!--ZZZ:--> <!--<h2 class="no-num no-toc">W3C Working Draft 25 August 2009</h2>--> - <h2 class="no-num no-toc" id="editor-s-draft-28-september-2009">Editor's Draft 28 September 2009</h2> + <h2 class="no-num no-toc" id="editor-s-draft-29-september-2009">Editor's Draft 29 September 2009</h2> <!--:ZZZ--> <dl><!-- ZZZ: update the month/day (twice), (un)comment out--><!-- <dt>This Version:</dt> @@ -240,7 +240,7 @@ </dl><p>This specification is available in the following formats: <a href="spec.html">single page HTML</a>, <a href="Overview.html">multipage HTML</a>. -This is revision 1.3173. +This is revision 1.3174. </p> <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2009 <a href="http://www.w3.org/"><abbr title="World Wide @@ -319,7 +319,7 @@ track. <!--ZZZ:--> <!--This specification is the 25 August 2009 Working Draft.--> - This specification is the 28 September 2009 Editor's Draft. + This specification is the 29 September 2009 Editor's Draft. <!--:ZZZ--> </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is also being produced by the <a href="http://www.whatwg.org/">WHATWG</a>. The two specifications are identical from the table of contents onwards.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) --><p>This specification is intended to replace (be a new version of) Index: embedded-content-0.html =================================================================== RCS file: /sources/public/html5/spec-author-view/embedded-content-0.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- embedded-content-0.html 28 Sep 2009 23:47:09 -0000 1.251 +++ embedded-content-0.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="dom.html">← 3 Semantics, structure, and APIs of HTML documents</a> – <a href="Overview.html#contents">Table of contents</a> – Index: dom.html =================================================================== RCS file: /sources/public/html5/spec-author-view/dom.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- dom.html 28 Sep 2009 23:47:09 -0000 1.252 +++ dom.html 29 Sep 2009 00:17:08 -0000 1.253 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="infrastructure.html">← 2 Common infrastructure</a> – <a href="Overview.html#contents">Table of contents</a> – Index: acknowledgements.html =================================================================== RCS file: /sources/public/html5/spec-author-view/acknowledgements.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- acknowledgements.html 28 Sep 2009 23:47:09 -0000 1.251 +++ acknowledgements.html 29 Sep 2009 00:17:08 -0000 1.252 @@ -217,7 +217,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="references.html">← References</a> – <a href="Overview.html#contents">Table of contents</a> Index: the-canvas-element.html =================================================================== RCS file: /sources/public/html5/spec-author-view/the-canvas-element.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- the-canvas-element.html 28 Sep 2009 23:47:10 -0000 1.251 +++ the-canvas-element.html 29 Sep 2009 00:17:10 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="video.html">← 4.8.7 The video element</a> – <a href="Overview.html#contents">Table of contents</a> – Index: iana-considerations.html =================================================================== RCS file: /sources/public/html5/spec-author-view/iana-considerations.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- iana-considerations.html 28 Sep 2009 23:47:09 -0000 1.251 +++ iana-considerations.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="obsolete.html">← 11 Obsolete features</a> – <a href="Overview.html#contents">Table of contents</a> – Index: forms.html =================================================================== RCS file: /sources/public/html5/spec-author-view/forms.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- forms.html 28 Sep 2009 23:47:09 -0000 1.251 +++ forms.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="tabular-data.html">← 4.9 Tabular data</a> – <a href="Overview.html#contents">Table of contents</a> – Index: interactive-elements.html =================================================================== RCS file: /sources/public/html5/spec-author-view/interactive-elements.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- interactive-elements.html 28 Sep 2009 23:47:09 -0000 1.251 +++ interactive-elements.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="forms.html">← 4.10 Forms</a> – <a href="Overview.html#contents">Table of contents</a> – Index: editing.html =================================================================== RCS file: /sources/public/html5/spec-author-view/editing.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- editing.html 28 Sep 2009 23:47:09 -0000 1.251 +++ editing.html 29 Sep 2009 00:17:08 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="history.html">← 6.8 Session history and navigation</a> – <a href="Overview.html#contents">Table of contents</a> – Index: video.html =================================================================== RCS file: /sources/public/html5/spec-author-view/video.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- video.html 28 Sep 2009 23:47:11 -0000 1.251 +++ video.html 29 Sep 2009 00:17:10 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="text-level-semantics.html">← 4.6 Text-level semantics</a> – <a href="Overview.html#contents">Table of contents</a> – Index: browsers.html =================================================================== RCS file: /sources/public/html5/spec-author-view/browsers.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- browsers.html 28 Sep 2009 23:47:09 -0000 1.252 +++ browsers.html 29 Sep 2009 00:17:08 -0000 1.253 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="microdata.html">← 5 Microdata</a> – <a href="Overview.html#contents">Table of contents</a> – Index: the-xhtml-syntax.html =================================================================== RCS file: /sources/public/html5/spec-author-view/the-xhtml-syntax.html,v retrieving revision 1.250 retrieving revision 1.251 diff -u -d -r1.250 -r1.251 --- the-xhtml-syntax.html 28 Sep 2009 23:47:10 -0000 1.250 +++ the-xhtml-syntax.html 29 Sep 2009 00:17:10 -0000 1.251 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="named-character-references.html">← 9.2 Named character references</a> – <a href="Overview.html#contents">Table of contents</a> – Index: offline.html =================================================================== RCS file: /sources/public/html5/spec-author-view/offline.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- offline.html 28 Sep 2009 23:47:09 -0000 1.251 +++ offline.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="browsers.html">← 6 Web browsers</a> – <a href="Overview.html#contents">Table of contents</a> – Index: syntax.html =================================================================== RCS file: /sources/public/html5/spec-author-view/syntax.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- syntax.html 28 Sep 2009 23:47:10 -0000 1.252 +++ syntax.html 29 Sep 2009 00:17:09 -0000 1.253 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="comms.html">← 8 Communication</a> – <a href="Overview.html#contents">Table of contents</a> – Index: obsolete.html =================================================================== RCS file: /sources/public/html5/spec-author-view/obsolete.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- obsolete.html 28 Sep 2009 23:47:09 -0000 1.252 +++ obsolete.html 29 Sep 2009 00:17:09 -0000 1.253 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="the-xhtml-syntax.html">← 10 The XHTML syntax</a> – <a href="Overview.html#contents">Table of contents</a> – Index: named-character-references.html =================================================================== RCS file: /sources/public/html5/spec-author-view/named-character-references.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- named-character-references.html 28 Sep 2009 23:47:09 -0000 1.252 +++ named-character-references.html 29 Sep 2009 00:17:09 -0000 1.253 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="syntax.html">← 9 The HTML syntax</a> – <a href="Overview.html#contents">Table of contents</a> – Index: references.html =================================================================== RCS file: /sources/public/html5/spec-author-view/references.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- references.html 28 Sep 2009 23:47:10 -0000 1.251 +++ references.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="index.html">← Index</a> – <a href="Overview.html#contents">Table of contents</a> – Index: semantics.html =================================================================== RCS file: /sources/public/html5/spec-author-view/semantics.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- semantics.html 28 Sep 2009 23:47:10 -0000 1.251 +++ semantics.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="embedded-content-0.html">← 3.2.5.1.6 Embedded content</a> – <a href="Overview.html#contents">Table of contents</a> – Index: index.html =================================================================== RCS file: /sources/public/html5/spec-author-view/index.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- index.html 28 Sep 2009 23:47:09 -0000 1.251 +++ index.html 29 Sep 2009 00:17:09 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="iana-considerations.html">← IANA considerations</a> – <a href="Overview.html#contents">Table of contents</a> – Index: comms.html =================================================================== RCS file: /sources/public/html5/spec-author-view/comms.html,v retrieving revision 1.251 retrieving revision 1.252 diff -u -d -r1.251 -r1.252 --- comms.html 28 Sep 2009 23:47:09 -0000 1.251 +++ comms.html 29 Sep 2009 00:17:08 -0000 1.252 @@ -218,7 +218,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="editing.html">← 7 User Interaction</a> – <a href="Overview.html#contents">Table of contents</a> – Index: spec.html =================================================================== RCS file: /sources/public/html5/spec-author-view/spec.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- spec.html 28 Sep 2009 23:47:10 -0000 1.252 +++ spec.html 29 Sep 2009 00:17:09 -0000 1.253 @@ -215,7 +215,7 @@ <h2 class="no-num no-toc" id=a-vocabulary-and-associated-apis-for-html-and-xhtml>A vocabulary and associated APIs for HTML and XHTML</h2> <!--ZZZ:--> <!--<h2 class="no-num no-toc">W3C Working Draft 25 August 2009</h2>--> - <h2 class="no-num no-toc" id=editor-s-draft-28-september-2009>Editor's Draft 28 September 2009</h2> + <h2 class="no-num no-toc" id=editor-s-draft-29-september-2009>Editor's Draft 29 September 2009</h2> <!--:ZZZ--> <dl><!-- ZZZ: update the month/day (twice), (un)comment out--><!-- <dt>This Version:</dt> @@ -238,7 +238,7 @@ </dl><p>This specification is available in the following formats: <a href=spec.html>single page HTML</a>, <a href=Overview.html>multipage HTML</a>. -This is revision 1.3173. +This is revision 1.3174. </p> <p class=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2009 <a href=http://www.w3.org/><abbr title="World Wide @@ -317,7 +317,7 @@ track. <!--ZZZ:--> <!--This specification is the 25 August 2009 Working Draft.--> - This specification is the 28 September 2009 Editor's Draft. + This specification is the 29 September 2009 Editor's Draft. <!--:ZZZ--> </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- relationship to other work (required) --><p>This specification is also being produced by the <a href=http://www.whatwg.org/>WHATWG</a>. The two specifications are identical from the table of contents onwards.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- context and rationale (required) --><p>This specification is intended to replace (be a new version of) @@ -23589,7 +23589,71 @@ 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><!-- XXX add a pushState() example here, for bug 7621 --><h4 id=activating-state-object-entries><span class=secno>6.8.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4><pre class=idl>interface <dfn id=popstateevent>PopStateEvent</dfn> : Event { + in its <a href=#session-history>session history</a>.</p><div class=example> + + <p>Consider a game where the user can navigate along a line, such + that the user is always at some coordinate, and such that the user + can bookmark the page corresponding to a particular coordinate, to + return to it later.</p> + + <p>A static page implementing the x=5 position in such a game could + look like the following:</p> + + <pre><!DOCTYPE HTML> +<!-- this is http://example.com/line?x=5 --> +<title>Line Game - 5</title> +<p>You are at coordinate 5 on the line.</p> +<p> + <a href="?x=6">Advance to 6</a> or + <a href="?x=4">retreat to 4</a>? +</p></pre> + + <p>The problem with such a system is that each time the user + clicks, the whole page has to be reloaded. Here instead is another + way of doing it, using script:</p> + + <pre><!DOCTYPE HTML> +<!-- this starts off as http://example.com/line?x=5 --> +<title>Line Game - 5</title> +<p>You are at coordinate <span id="coord">5</span> on the line.</p> +<p> + <a href="?x=6" onclick="go(1)">Advance to 6</a> or + <a href="?x=4" onclick="go(-1)">retreat to 4</a>? +</p> +<script> + var currentPage = 5; // prefilled by server + function go(d) { + history.pushState(currentPage, 'Line Game - ' + currentPage, '?x=' + currentPage); + setupPage(currentPage + d); + } + onpopstate = function(event) { + setupPage(event.state); + } + function setupPage(page) { + currentPage = page; + document.title = 'Line Game - ' + currentPage; + document.getElementById('coord').textContent = currentPage; + document.links[0].href = '?x=' + (currentPage+1); + document.links[0].textContent = 'Advance to ' + (currentPage+1); + document.links[1].href = '?x=' + (currentPage-1); + document.links[1].textContent = 'retreat to ' + (currentPage-1); + } +</script></pre> + + <p>In systems without script, this still works like the previous + example. However, users that <em>do</em> have script support can + now navigate much faster, since there is no network access for the + same experience. Furthermore, contrary to the experience the user + would have with just a naïve script-based approach, + bookmarking and navigating the session history still work.</p> + + <p>In the example above, the <var title="">data</var> argument to + the <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> method + is the same information as would be sent to the server, but in a + more convenient form, so that the script doesn't have to parse the + URL each time the user navigates.</p> + + </div><h4 id=activating-state-object-entries><span class=secno>6.8.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4><pre class=idl>interface <dfn id=popstateevent>PopStateEvent</dfn> : Event { readonly attribute any <a href=#dom-popstateevent-state title=dom-PopStateEvent-state>state</a>; void <a href=#dom-popstateevent-initpopstateevent title=dom-PopStateEvent-initPopStateEvent>initPopStateEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg); void <a href=#dom-popstateevent-initpopstateeventns title=dom-PopStateEvent-initPopStateEventNS>initPopStateEventNS</a>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg); Index: introduction.html =================================================================== RCS file: /sources/public/html5/spec-author-view/introduction.html,v retrieving revision 1.252 retrieving revision 1.253 diff -u -d -r1.252 -r1.253 --- introduction.html 28 Sep 2009 23:47:09 -0000 1.252 +++ introduction.html 29 Sep 2009 00:17:09 -0000 1.253 @@ -217,7 +217,7 @@ <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p> <h1>HTML5</h1> <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2> -<p>This is revision 1.3173.</p> +<p>This is revision 1.3174.</p> </div><div> <a href="Overview.html#contents">Table of contents</a> – <a href="infrastructure.html">2 Common infrastructure →</a>
Received on Tuesday, 29 September 2009 00:17:43 UTC