[html5] r4632 - [agiow] (2) Make history traversal unrelated to history truncation always async. [...]
whatwg at whatwg.org
whatwg at whatwg.org
Thu Jan 28 17:31:40 PST 2010
Author: ianh
Date: 2010-01-28 17:31:38 -0800 (Thu, 28 Jan 2010)
New Revision: 4632
Modified:
complete.html
index
source
Log:
[agiow] (2) Make history traversal unrelated to history truncation always async. Make popstate/hashchange async. Add context information to hashchange.
Modified: complete.html
===================================================================
--- complete.html 2010-01-28 01:22:24 UTC (rev 4631)
+++ complete.html 2010-01-29 01:31:38 UTC (rev 4632)
@@ -110,7 +110,7 @@
<header class=head id=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 — 28 January 2010</h2>
+ <h2 class="no-num no-toc">Draft Standard — 29 January 2010</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>-->
@@ -728,11 +728,10 @@
<ol>
<li><a href=#the-session-history-of-browsing-contexts><span class=secno>6.10.1 </span>The session history of browsing contexts</a></li>
<li><a href=#the-history-interface><span class=secno>6.10.2 </span>The <code>History</code> interface</a></li>
- <li><a href=#activating-state-object-entries><span class=secno>6.10.3 </span>Activating state object entries</a></li>
- <li><a href=#the-location-interface><span class=secno>6.10.4 </span>The <code>Location</code> interface</a>
+ <li><a href=#the-location-interface><span class=secno>6.10.3 </span>The <code>Location</code> interface</a>
<ol>
- <li><a href=#security-3><span class=secno>6.10.4.1 </span>Security</a></ol></li>
- <li><a href=#history-notes><span class=secno>6.10.5 </span>Implementation notes for session history</a></ol></li>
+ <li><a href=#security-3><span class=secno>6.10.3.1 </span>Security</a></ol></li>
+ <li><a href=#history-notes><span class=secno>6.10.4 </span>Implementation notes for session history</a></ol></li>
<li><a href=#browsing-the-web><span class=secno>6.11 </span>Browsing the Web</a>
<ol>
<li><a href=#navigating-across-documents><span class=secno>6.11.1 </span>Navigating across documents</a></li>
@@ -743,7 +742,9 @@
<li><a href=#read-plugin><span class=secno>6.11.6 </span>Page load processing model for content that uses plugins</a></li>
<li><a href=#read-ua-inline><span class=secno>6.11.7 </span>Page load processing model for inline content that doesn't have a DOM</a></li>
<li><a href=#scroll-to-fragid><span class=secno>6.11.8 </span>Navigating to a fragment identifier</a></li>
- <li><a href=#history-traversal><span class=secno>6.11.9 </span>History traversal</a></li>
+ <li><a href=#history-traversal><span class=secno>6.11.9 </span>History traversal</a>
+ <ol>
+ <li><a href=#event-definitions><span class=secno>6.11.9.1 </span>Event definitions</a></ol></li>
<li><a href=#unloading-documents><span class=secno>6.11.10 </span>Unloading documents</a>
<ol>
<li><a href=#event-definition><span class=secno>6.11.10.1 </span>Event definition</a></ol></li>
@@ -893,7 +894,7 @@
<li><a href=#worker-locations><span class=secno>9.3.5 </span>Worker locations</a></ol></ol></li>
<li><a href=#comms><span class=secno>10 </span>Communication</a>
<ol>
- <li><a href=#event-definitions><span class=secno>10.1 </span>Event definitions</a></li>
+ <li><a href=#event-definitions-0><span class=secno>10.1 </span>Event definitions</a></li>
<li><a href=#server-sent-events><span class=secno>10.2 </span>Server-sent events</a>
<ol>
<li><a href=#server-sent-events-intro><span class=secno>10.2.1 </span>Introduction</a></li>
@@ -9856,21 +9857,20 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a> queued by
+ the <a href=#history-traversal-task-source>history traversal task source</a>.</li>
+
<li>Remove any earlier entries that share the same
<code>Document</code>.</li>
- <li>
+ <li><p>If <var title="">replace</var> is false, then add a new
+ entry, just before the last entry, and associate with the new entry
+ the text that was parsed by the previous parser associated with the
+ <code>Document</code> object, as well as the state of the document
+ at the start of these steps. (This allows the user to step
+ backwards in the session history to see the page before it was
+ blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</li>
- <p>If <var title="">replace</var> is false, then add a new entry,
- just before the last entry, and assocaite with the new entry the
- text that was parsed by the previous parser associated with the
- <code>Document</code> object, as well as the state of the document
- at the start of these steps. (This allows the user to step
- backwards in the session history to see the page before it was
- blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</p>
-
- </li>
-
<li><p>Finally, set the <a href=#insertion-point>insertion point</a> to point at
just before the end of the <a href=#the-input-stream>input stream</a> (which at this
point will be empty).</li>
@@ -20618,8 +20618,10 @@
its <code title=attr-object-type><a href=#attr-object-type>type</a></code> attribute is set,
changed, or removed: the user agent must <a href=#queue-a-task>queue a task</a>
to run the following steps to (re)determine what the
- <code><a href=#the-object-element>object</a></code> element represents:</p>
- <!-- Changing the base URL doesn't trigger this. -->
+ <code><a href=#the-object-element>object</a></code> element represents. The <a href=#task-source>task source</a>
+ for this <a href=#concept-task title=concept-task>task</a> is the <a href=#dom-manipulation-task-source>DOM
+ manipulation task source</a>.</p> <!-- Changing the base URL
+ doesn't trigger this. -->
<ol><li>
@@ -20970,10 +20972,7 @@
<a href=#fallback-content>fallback content</a>. If the element has an instantiated
<a href=#plugin>plugin</a>, then unload it.</li>
- </ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>task</a> above is the <a href=#dom-manipulation-task-source>DOM manipulation
- task source</a>.</p>
-
- <p id=object-plugin>When the algorithm above instantiates a
+ </ol><p id=object-plugin>When the algorithm above instantiates a
<a href=#plugin>plugin</a>, the user agent should pass the names and values
of all the attributes on the element, and <!-- then a parameter
named "PARAM" whose value is null, and then --> all the names and
@@ -51934,6 +51933,15 @@
</dd>
+ <dt>The <dfn id=history-traversal-task-source>history traversal task source</dfn></dt>
+
+ <dd>
+
+ <p>This <a href=#task-source>task source</a> is used to queue calls to <code title=dom-history-back><a href=#dom-history-back>history.back()</a></code> and similar
+ APIs.</p>
+
+ </dd>
+
</dl></div>
@@ -52409,7 +52417,7 @@
<tr><td><dfn id=handler-window-onblur title=handler-window-onblur><code>onblur</code></dfn> <td> <code title=event-blur>blur</code>
<tr><td><dfn id=handler-window-onerror title=handler-window-onerror><code>onerror</code></dfn> <td> <code title=event-error>error</code>
<tr><td><dfn id=handler-window-onfocus title=handler-window-onfocus><code>onfocus</code></dfn> <td> <code title=event-focus>focus</code>
- <tr><td><dfn id=handler-window-onhashchange title=handler-window-onhashchange><code>onhashchange</code></dfn> <td> <code title=event-hashchange>hashchange</code> <!-- new -->
+ <tr><td><dfn id=handler-window-onhashchange title=handler-window-onhashchange><code>onhashchange</code></dfn> <td> <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> <!-- new -->
<tr><td><dfn id=handler-window-onload title=handler-window-onload><code>onload</code></dfn> <td> <code title=event-load>load</code> <!-- widely used -->
<tr><td><dfn id=handler-window-onmessage title=handler-window-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code> <!-- new for postMessage -->
<tr><td><dfn id=handler-window-onoffline title=handler-window-onoffline><code>onoffline</code></dfn> <td> <code title=event-offline><a href=#event-offline>offline</a></code> <!-- new -->
@@ -55939,14 +55947,26 @@
<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 run the
- following steps:</p>
+ <p>When the <dfn id=dom-history-go title=dom-history-go><code>go(<var title="">delta</var>)</code></dfn> method is invoked, if the
+ argument to the method was omitted or has the value zero, 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. Otherwise, the user agent must <a href=#traverse-the-history-by-a-delta>traverse the
+ history by a delta</a> whose value is the value of the method's
+ argument.</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>When the <dfn id=dom-history-back title=dom-history-back><code>back()</code></dfn>
+ method is invoked, the user agent must <a href=#traverse-the-history-by-a-delta>traverse the history by
+ a delta</a> −1.</p>
- <li><p>Let <var title="">delta</var> be the argument to the
+ <p>When the <dfn id=dom-history-forward title=dom-history-forward><code>forward()</code></dfn>method is
+ invoked, the user agent must <a href=#traverse-the-history-by-a-delta>traverse the history by a
+ delta</a> +1.</p>
+
+ <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>
+
+ <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
@@ -55962,24 +55982,17 @@
<a href=#browsing-context>browsing context</a> of the <var title="">specified
entry</var>.</li>
+ <!-- XXX if going to another doc, try to unload the document here
+ (firing beforeunload, unload, pagehide) -->
+
<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>
+ <a href=#traverse-the-history-by-a-delta>traverse the history by a delta</a> equivalent to the
+ action specified by the user.</p>
- <p>Some of the other members of the <code><a href=#history-0>History</a></code> interface
- are defined in terms of the <code title=dom-history-go><a href=#dom-history-go>go()</a></code>
- method, as follows:</p>
-
- <table><tr><th>Member</th>
- <th>Definition</th>
- <tr><td><dfn id=dom-history-back title=dom-history-back><code>back()</code></dfn></td>
- <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><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 entry to
+ <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 entry to
the history.</p>
<p>The <dfn id=dom-history-replacestate title=dom-history-replaceState><code>replaceState(<var title="">data</var>, <var title="">title</var>, <var title="">url</var>)</code></dfn> method updates the state object,
@@ -56011,12 +56024,12 @@
<li>If the <a href=#origin>origin</a> of the resulting <a href=#absolute-url>absolute
URL</a> is not the same as the <a href=#origin>origin</a> of the
- <a href=#entry-script>entry script</a>'s <code title="script's browsing
- context"><a href="#script's-browsing-context">browsing context, and either the <span title=url-path><path></span> or <span title=url-query><query></span> components of the two
- <span title=URL>URLs</span> comparedi in the previous step
- differ, raise a <code>SECURITY_ERR</code> exception and abort
+ <a href=#entry-script>entry script</a>'s <a href="#script's-browsing-context" title="script's browsing
+ context">browsing context</a>, and either the <a href=#url-path title=url-path><path></a> or <a href=#url-query title=url-query><query></a> components of the two
+ <a href=#url title=URL>URLs</a> comparedi in the previous step
+ differ, raise a <code><a href=#security_err>SECURITY_ERR</a></code> exception and abort
these steps. (This prevents sandboxed content from spoofing other
- pages on the same origin.)</a></code></li>
+ pages on the same origin.)</li>
</ol><p>For the purposes of the comparisons in the above substeps, the
<a href=#url-path title=url-path><path></a> and <a href=#url-query title=url-query><query></a> components can only be the
@@ -56042,6 +56055,9 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a> queued
+ by the <a href=#history-traversal-task-source>history traversal task source</a>.</li>
+
<li><p>Add a state object entry to the session history, after the
<a href=#current-entry>current entry</a>, with <var title="">cloned data</var> as
the state object, the given <var title="">title</var> as the title,
@@ -56071,7 +56087,7 @@
<p class=note>Since this is neither a <a href=#navigate title=navigate>navigation</a> of the <a href=#browsing-context>browsing
context</a> nor a <a href=#traverse-the-history title="traverse the history">history
- traversal</a>, it does not cause a <code title=event-hashchange>hashchange</code> event to be fired.</p>
+ traversal</a>, it does not cause a <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> event to be fired.</p>
</li>
@@ -56186,78 +56202,8 @@
- <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>
+ <h4 id=the-location-interface><span class=secno>6.10.3 </span>The <code><a href=#location>Location</a></code> interface</h4>
- <div class=impl>
-
- <p>When an entry in the session history is activated (which happens
- during <a href=#traverse-the-history title="traverse the history">session history
- traversal</a>), the user agent must run the following steps:</p>
-
- <ol><!-- only called for the first entry of a Document set and for
- state object entries, not for frag id change entries --><li><p>If the entry is a <a href=#state-object>state object</a> entry, let <var title="">state</var> be a <a href=#structured-clone>structured clone</a> of that
- state object. Otherwise, let <var title="">state</var> be
- null.</li>
-
- <li>
-
- <p>Run the appropriate steps according to the conditions
- described:</p>
-
- <dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
- string "complete"</dt>
-
- <dd><p>Synchronously fire a <dfn id=event-popstate title=event-popstate><code>popstate</code></dfn> event on the
- <code><a href=#window>Window</a></code> object of the <code>Document</code>, using
- the <code><a href=#popstateevent>PopStateEvent</a></code> interface, with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code> attribute set to the
- value of <var title="">state</var>. This event must bubble but
- not be cancelable and has no default action.</dd>
-
- <dt>Otherwise</dt>
-
- <dd><p>Let the <code>Document</code>'s <dfn id=pending-state-object>pending state
- object</dfn> be <var title="">state</var>. (If there was already
- a <a href=#pending-state-object>pending state object</a>, the previous one is
- discarded.)</p>
-
- <p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>
-
- </dl></li>
-
- </ol><p>The <a href=#pending-state-object>pending state object</a> must be initially null.</p>
-
- <hr></div>
-
- <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);
-};</pre>
-
- <dl class=domintro><dt><var title="">event</var> . <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code></dt>
-
- <dd>
-
- <p>Returns the information that was provided to <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> or <code title=dom-history-replaceState><a href=#dom-history-replacestate>replaceState()</a></code>.</p>
-
- </dd>
-
- </dl><div class=impl>
-
- <p>The <dfn id=dom-popstateevent-initpopstateevent title=dom-PopStateEvent-initPopStateEvent><code>initPopStateEvent()</code></dfn>
- method must initialize the event in a manner analogous to the
- similarly-named method in the DOM Events interfaces. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
-
- <p>The <dfn id=dom-popstateevent-state title=dom-PopStateEvent-state><code>state</code></dfn>
- attribute represents the context information for the event, or null,
- if the state represented is the initial state of the
- <code>Document</code>.</p>
-
- </div>
-
-
-
- <h4 id=the-location-interface><span class=secno>6.10.4 </span>The <code><a href=#location>Location</a></code> interface</h4>
-
<p>Each <code>Document</code> object in a <a href=#browsing-context>browsing
context</a>'s session history is associated with a unique
instance of a <code><a href=#location>Location</a></code> object.</p>
@@ -56464,7 +56410,7 @@
<div class=impl>
- <h5 id=security-3><span class=secno>6.10.4.1 </span>Security</h5>
+ <h5 id=security-3><span class=secno>6.10.3.1 </span>Security</h5>
<p>User agents must raise a <code><a href=#security_err>SECURITY_ERR</a></code> exception whenever
any of the members of a <code><a href=#location>Location</a></code> object are accessed by
@@ -56487,7 +56433,7 @@
<div class=impl>
- <h4 id=history-notes><span class=secno>6.10.5 </span>Implementation notes for session history</h4>
+ <h4 id=history-notes><span class=secno>6.10.4 </span>Implementation notes for session history</h4>
<!-- don't change the ID without updating multiple internal links -->
<p><i>This section is non-normative.</i></p>
@@ -56925,6 +56871,12 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a>
+ queued by the <a href=#history-traversal-task-source>history traversal task
+ source</a>.</li> <!-- so the network is racing
+ history.back(), in the case of setting location.href="" and
+ then calling history.back() -->
+
<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its
<code>Document</code> object and related state.</li>
@@ -57212,6 +57164,9 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a> queued by
+ the <a href=#history-traversal-task-source>history traversal task source</a>.</li>
+
<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its <code>Document</code>
object and related state. Its <a href=#url>URL</a> must be set to the
@@ -57282,9 +57237,14 @@
document</a>, if that is an element; otherwise there is no
<i><a href=#target-element>target element</a></i>. <a href=#refsSELECTORS>[SELECTORS]</a></p>
+ </div>
- <h4 id=history-traversal><span class=secno>6.11.9 </span>History traversal</h4>
+
+ <h4 id=history-traversal><span class=secno>6.11.9 </span>History traversal</h4> <!-- session history -->
+
+ <div class=impl>
+
<p>When a user agent is required to <dfn id=traverse-the-history>traverse the history</dfn>
to a <i>specified entry</i>, optionally with <a href=#replacement-enabled>replacement
enabled</a>, the user agent must act as follows:</p>
@@ -57301,8 +57261,6 @@
created. (This can never happen with <a href=#replacement-enabled>replacement
enabled</a>.)</li>
- <li><p>Release the <a href=#storage-mutex>storage mutex</a>.</li>
-
<li><p>If the <a href=#current-entry>current entry</a>'s title was not set by the
<code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> or <code title=dom-history-replaceState><a href=#dom-history-replacestate>replaceState()</a></code> methods,
then set its title to the value returned by the <code title=dom-document-title><a href=#document.title>document.title</a></code> IDL
@@ -57383,7 +57341,10 @@
<li><p>If the <i>specified entry</i> has a URL that differs from
the <a href=#current-entry>current entry</a>'s only by its fragment identifier,
and the two share the same <code>Document</code> object, then let
- <var title="">hash changed</var> be true. Otherwise, let <var title="">hash changed</var> be false.</li>
+ <var title="">hash changed</var> be true, and let <var title="">old
+ URL</var> be the URL of the <a href=#current-entry>current entry</a> and <var title="">new URL</var> be the URL of the <i>specified
+ entry</i>. Otherwise, let <var title="">hash changed</var> be
+ false.</li>
<li><p>If the traversal was initiated with <dfn id=replacement-enabled>replacement
enabled</dfn>, remove the entry immediately before the
@@ -57398,22 +57359,144 @@
view, for instance the scroll position or values of form fields,
that it had previously recorded.</li>
- <li><p>If the <i>specified entry</i> is a state object or the
- first entry for a <code>Document</code>, the user agent must <a href=#activating-state-object-entries title="activate the state object">activate that
- entry</a>.</li>
+ <li>
+ <p>If the <i>specified entry</i> is a state object or the first
+ entry for a <code>Document</code>, the user agent must run the
+ following substeps:</p>
+
+ <ol><li><p>If the entry is a <a href=#state-object>state object</a> entry, let <var title="">state</var> be a <a href=#structured-clone>structured clone</a> of that
+ state object. Otherwise, let <var title="">state</var> be
+ null.</li>
+
+ <li>
+
+ <p>Run the appropriate steps according to the conditions
+ described:</p>
+
+ <dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
+ string "complete"</dt>
+
+ <dd><p><a href=#queue-a-task>Queue a task</a> to fire a <code title=event-popstate><a href=#event-popstate>popstate</a></code> event at the
+ <code><a href=#window>Window</a></code> object of the <code>Document</code>, using
+ the <code><a href=#popstateevent>PopStateEvent</a></code> interface, with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code> attribute set to
+ the value of <var title="">state</var>. This event must bubble
+ but not be cancelable and has no default action.</dd>
+
+ <dt>Otherwise</dt>
+
+ <dd><p>Let the <code>Document</code>'s <dfn id=pending-state-object>pending state
+ object</dfn> be <var title="">state</var>. (If there was already
+ a <a href=#pending-state-object>pending state object</a>, the previous one is
+ discarded.)</p>
+
+ <p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>
+
+ </dl></li>
+
+ </ol></li>
+
<li><p>If <var title="">hash changed</var> is true, then
- synchronously <a href=#fire-a-simple-event>fire a simple event</a> with the name <code title=event-hashchange>hashchange</code> at the <a href=#browsing-context>browsing
- context</a>'s <code><a href=#window>Window</a></code> object.</li>
+ <a href=#queue-a-task>queue a task</a> to fire a <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> event at the
+ <a href=#browsing-context>browsing context</a>'s <code><a href=#window>Window</a></code> object, using
+ the <code><a href=#hashchangeevent>HashChangeEvent</a></code> interface, with the <code title=dom-HashChangeEvent-oldURL><a href=#dom-hashchangeevent-oldurl>oldURL</a></code> attribute set to
+ <var title="">old URL</var> and the <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code> attribute set to
+ <var title="">new URL</var>. This event must bubble but not be
+ cancelable and has no default action.</li>
- <li><p>Release the <a href=#storage-mutex>storage mutex</a> again.</li>
-
<li><p>The <a href=#current-entry>current entry</a> is now the <i>specified
entry</i>.</li>
- </ol></div>
+ </ol><p>The <a href=#pending-state-object>pending state object</a> must be initially null.</p>
+ <p>The <a href=#task-source>task source</a> for the tasks mentioned above is the
+ <a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>
+
+ <h5 id=event-definitions><span class=secno>6.11.9.1 </span>Event definitions</h5>
+
+ </div>
+
+ <p>The <dfn id=event-popstate title=event-popstate><code>popstate</code></dfn> event
+ is fired when navigating to a <a href=#session-history-entry>session history entry</a>
+ that represents a state object.</p>
+
+ <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);
+};</pre>
+
+ <dl class=domintro><dt><var title="">event</var> . <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code></dt>
+
+ <dd>
+
+ <p>Returns the information that was provided to <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> or <code title=dom-history-replaceState><a href=#dom-history-replacestate>replaceState()</a></code>.</p>
+
+ </dd>
+
+ </dl><div class=impl>
+
+ <p>The <dfn id=dom-popstateevent-initpopstateevent title=dom-PopStateEvent-initPopStateEvent><code>initPopStateEvent()</code></dfn>
+ method must initialize the event in a manner analogous to the
+ similarly-named method in the DOM Events interfaces. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
+
+ <p>The <dfn id=dom-popstateevent-state title=dom-PopStateEvent-state><code>state</code></dfn>
+ attribute represents the context information for the event, or null,
+ if the state represented is the initial state of the
+ <code>Document</code>.</p>
+
+ </div>
+
+ <hr><p>The <dfn id=event-hashchange title=event-hashchange><code>hashchange</code></dfn>
+ event is fired when navigating to a <a href=#session-history-entry>session history
+ entry</a> whose <a href=#url>URL</a> differs from that of the
+ previous one only in the fragment identifier.</p>
+
+ <pre class=idl>interface <dfn id=hashchangeevent>HashChangeEvent</dfn> : Event {
+ readonly attribute any <a href=#dom-hashchangeevent-oldurl title=dom-HashChangeEvent-oldURL>oldURL</a>;
+ readonly attribute any <a href=#dom-hashchangeevent-newurl title=dom-HashChangeEvent-newURL>newURL</a>;
+ void <a href=#dom-hashchangeevent-inithashchangeevent title=dom-HashChangeEvent-initHashChangeEvent>initHashChangeEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString oldURLArg, in DOMString newURLArg);
+};</pre>
+
+ <dl class=domintro><dt><var title="">event</var> . <code title=dom-HashChangeEvent-oldURL><a href=#dom-hashchangeevent-oldurl>oldURL</a></code></dt>
+
+ <dd>
+
+ <p>Returns the <a href=#url>URL</a> of the <a href=#session-history-entry>session history
+ entry</a> that was previously current.</p>
+
+ </dd>
+
+
+ <dt><var title="">event</var> . <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code></dt>
+
+ <dd>
+
+ <p>Returns the <a href=#url>URL</a> of the <a href=#session-history-entry>session history
+ entry</a> that is now current.</p>
+
+ </dd>
+
+ </dl><div class=impl>
+
+ <p>The <dfn id=dom-hashchangeevent-inithashchangeevent title=dom-HashChangeEvent-initHashChangeEvent><code>initHashChangeEvent()</code></dfn>
+ method must initialize the event in a manner analogous to the
+ similarly-named method in the DOM Events interfaces. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
+
+ <p>The <dfn id=dom-hashchangeevent-oldurl title=dom-HashChangeEvent-oldURL><code>oldURL</code></dfn>
+ attribute represents context information for the event, specifically
+ the URL of the <a href=#session-history-entry>session history entry</a> that was traversed
+ from.</p>
+
+ <p>The <dfn id=dom-hashchangeevent-newurl title=dom-HashChangeEvent-newURL><code>newURL</code></dfn>
+ attribute represents context information for the event, specifically
+ the URL of the <a href=#session-history-entry>session history entry</a> that was traversed
+ to.</p>
+
+ </div>
+
+
+
<h4 id=unloading-documents><span class=secno>6.11.10 </span>Unloading documents</h4>
<div class=impl>
@@ -57588,6 +57671,8 @@
</div>
+ <div class=impl>
+
<h4 id=aborting-a-document-load><span class=secno>6.11.11 </span>Aborting a document load</h4>
<p>If the user cancels any instance of the <a href=#fetch title=fetch>fetching algorithm</a> in the context of a
@@ -57600,8 +57685,10 @@
<!-- I'd love to make this more precise, anyone have any suggestions
on what it should say? -->
+ </div>
+
<h3 id=links><span class=secno>6.12 </span>Links</h3>
@@ -65471,7 +65558,7 @@
- <h3 id=event-definitions><span class=secno>10.1 </span>Event definitions</h3>
+ <h3 id=event-definitions-0><span class=secno>10.1 </span>Event definitions</h3>
<p>Messages in <a href=#server-sent-events>server-sent events</a>, <a href=#network>Web
sockets</a>, <a href=#crossDocumentMessages>cross-document messaging</a>, and
@@ -86426,7 +86513,7 @@
<tr><th> <code title="">onhashchange</code>
<td> <code title=handler-window-onhashchange><a href=#handler-window-onhashchange>body</a></code>
- <td> <code title=event-hashchange>hashchange</code> event handler for <code><a href=#window>Window</a></code> object
+ <td> <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> event handler for <code><a href=#window>Window</a></code> object
<td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
<tr><th> <code title="">oninput</code>
Modified: index
===================================================================
--- index 2010-01-28 01:22:24 UTC (rev 4631)
+++ index 2010-01-29 01:31:38 UTC (rev 4632)
@@ -112,7 +112,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<hgroup><h1>HTML5 (including next generation additions still in development)</h1>
- <h2 class="no-num no-toc">Draft Standard — 28 January 2010</h2>
+ <h2 class="no-num no-toc">Draft Standard — 29 January 2010</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>-->
@@ -735,11 +735,10 @@
<ol>
<li><a href=#the-session-history-of-browsing-contexts><span class=secno>6.10.1 </span>The session history of browsing contexts</a></li>
<li><a href=#the-history-interface><span class=secno>6.10.2 </span>The <code>History</code> interface</a></li>
- <li><a href=#activating-state-object-entries><span class=secno>6.10.3 </span>Activating state object entries</a></li>
- <li><a href=#the-location-interface><span class=secno>6.10.4 </span>The <code>Location</code> interface</a>
+ <li><a href=#the-location-interface><span class=secno>6.10.3 </span>The <code>Location</code> interface</a>
<ol>
- <li><a href=#security-3><span class=secno>6.10.4.1 </span>Security</a></ol></li>
- <li><a href=#history-notes><span class=secno>6.10.5 </span>Implementation notes for session history</a></ol></li>
+ <li><a href=#security-3><span class=secno>6.10.3.1 </span>Security</a></ol></li>
+ <li><a href=#history-notes><span class=secno>6.10.4 </span>Implementation notes for session history</a></ol></li>
<li><a href=#browsing-the-web><span class=secno>6.11 </span>Browsing the Web</a>
<ol>
<li><a href=#navigating-across-documents><span class=secno>6.11.1 </span>Navigating across documents</a></li>
@@ -750,7 +749,9 @@
<li><a href=#read-plugin><span class=secno>6.11.6 </span>Page load processing model for content that uses plugins</a></li>
<li><a href=#read-ua-inline><span class=secno>6.11.7 </span>Page load processing model for inline content that doesn't have a DOM</a></li>
<li><a href=#scroll-to-fragid><span class=secno>6.11.8 </span>Navigating to a fragment identifier</a></li>
- <li><a href=#history-traversal><span class=secno>6.11.9 </span>History traversal</a></li>
+ <li><a href=#history-traversal><span class=secno>6.11.9 </span>History traversal</a>
+ <ol>
+ <li><a href=#event-definitions><span class=secno>6.11.9.1 </span>Event definitions</a></ol></li>
<li><a href=#unloading-documents><span class=secno>6.11.10 </span>Unloading documents</a>
<ol>
<li><a href=#event-definition><span class=secno>6.11.10.1 </span>Event definition</a></ol></li>
@@ -841,7 +842,7 @@
<li><a href=#editing-apis><span class=secno>7.11 </span>Editing APIs</a></ol></li>
<li><a href=#comms><span class=secno>8 </span>Communication</a>
<ol>
- <li><a href=#event-definitions><span class=secno>8.1 </span>Event definitions</a></li>
+ <li><a href=#event-definitions-0><span class=secno>8.1 </span>Event definitions</a></li>
<li><a href=#crossDocumentMessages><span class=secno>8.2 </span>Cross-document messaging</a>
<ol>
<li><a href=#introduction-5><span class=secno>8.2.1 </span>Introduction</a></li>
@@ -9756,21 +9757,20 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a> queued by
+ the <a href=#history-traversal-task-source>history traversal task source</a>.</li>
+
<li>Remove any earlier entries that share the same
<code>Document</code>.</li>
- <li>
+ <li><p>If <var title="">replace</var> is false, then add a new
+ entry, just before the last entry, and associate with the new entry
+ the text that was parsed by the previous parser associated with the
+ <code>Document</code> object, as well as the state of the document
+ at the start of these steps. (This allows the user to step
+ backwards in the session history to see the page before it was
+ blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</li>
- <p>If <var title="">replace</var> is false, then add a new entry,
- just before the last entry, and assocaite with the new entry the
- text that was parsed by the previous parser associated with the
- <code>Document</code> object, as well as the state of the document
- at the start of these steps. (This allows the user to step
- backwards in the session history to see the page before it was
- blown away by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> call.)</p>
-
- </li>
-
<li><p>Finally, set the <a href=#insertion-point>insertion point</a> to point at
just before the end of the <a href=#the-input-stream>input stream</a> (which at this
point will be empty).</li>
@@ -20518,8 +20518,10 @@
its <code title=attr-object-type><a href=#attr-object-type>type</a></code> attribute is set,
changed, or removed: the user agent must <a href=#queue-a-task>queue a task</a>
to run the following steps to (re)determine what the
- <code><a href=#the-object-element>object</a></code> element represents:</p>
- <!-- Changing the base URL doesn't trigger this. -->
+ <code><a href=#the-object-element>object</a></code> element represents. The <a href=#task-source>task source</a>
+ for this <a href=#concept-task title=concept-task>task</a> is the <a href=#dom-manipulation-task-source>DOM
+ manipulation task source</a>.</p> <!-- Changing the base URL
+ doesn't trigger this. -->
<ol><li>
@@ -20870,10 +20872,7 @@
<a href=#fallback-content>fallback content</a>. If the element has an instantiated
<a href=#plugin>plugin</a>, then unload it.</li>
- </ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>task</a> above is the <a href=#dom-manipulation-task-source>DOM manipulation
- task source</a>.</p>
-
- <p id=object-plugin>When the algorithm above instantiates a
+ </ol><p id=object-plugin>When the algorithm above instantiates a
<a href=#plugin>plugin</a>, the user agent should pass the names and values
of all the attributes on the element, and <!-- then a parameter
named "PARAM" whose value is null, and then --> all the names and
@@ -51839,6 +51838,15 @@
</dd>
+ <dt>The <dfn id=history-traversal-task-source>history traversal task source</dfn></dt>
+
+ <dd>
+
+ <p>This <a href=#task-source>task source</a> is used to queue calls to <code title=dom-history-back><a href=#dom-history-back>history.back()</a></code> and similar
+ APIs.</p>
+
+ </dd>
+
</dl></div>
@@ -52314,7 +52322,7 @@
<tr><td><dfn id=handler-window-onblur title=handler-window-onblur><code>onblur</code></dfn> <td> <code title=event-blur>blur</code>
<tr><td><dfn id=handler-window-onerror title=handler-window-onerror><code>onerror</code></dfn> <td> <code title=event-error>error</code>
<tr><td><dfn id=handler-window-onfocus title=handler-window-onfocus><code>onfocus</code></dfn> <td> <code title=event-focus>focus</code>
- <tr><td><dfn id=handler-window-onhashchange title=handler-window-onhashchange><code>onhashchange</code></dfn> <td> <code title=event-hashchange>hashchange</code> <!-- new -->
+ <tr><td><dfn id=handler-window-onhashchange title=handler-window-onhashchange><code>onhashchange</code></dfn> <td> <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> <!-- new -->
<tr><td><dfn id=handler-window-onload title=handler-window-onload><code>onload</code></dfn> <td> <code title=event-load>load</code> <!-- widely used -->
<tr><td><dfn id=handler-window-onmessage title=handler-window-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code> <!-- new for postMessage -->
<tr><td><dfn id=handler-window-onoffline title=handler-window-onoffline><code>onoffline</code></dfn> <td> <code title=event-offline><a href=#event-offline>offline</a></code> <!-- new -->
@@ -55853,14 +55861,26 @@
<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 run the
- following steps:</p>
+ <p>When the <dfn id=dom-history-go title=dom-history-go><code>go(<var title="">delta</var>)</code></dfn> method is invoked, if the
+ argument to the method was omitted or has the value zero, 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. Otherwise, the user agent must <a href=#traverse-the-history-by-a-delta>traverse the
+ history by a delta</a> whose value is the value of the method's
+ argument.</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>When the <dfn id=dom-history-back title=dom-history-back><code>back()</code></dfn>
+ method is invoked, the user agent must <a href=#traverse-the-history-by-a-delta>traverse the history by
+ a delta</a> −1.</p>
- <li><p>Let <var title="">delta</var> be the argument to the
+ <p>When the <dfn id=dom-history-forward title=dom-history-forward><code>forward()</code></dfn>method is
+ invoked, the user agent must <a href=#traverse-the-history-by-a-delta>traverse the history by a
+ delta</a> +1.</p>
+
+ <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>
+
+ <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
@@ -55876,24 +55896,17 @@
<a href=#browsing-context>browsing context</a> of the <var title="">specified
entry</var>.</li>
+ <!-- XXX if going to another doc, try to unload the document here
+ (firing beforeunload, unload, pagehide) -->
+
<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>
+ <a href=#traverse-the-history-by-a-delta>traverse the history by a delta</a> equivalent to the
+ action specified by the user.</p>
- <p>Some of the other members of the <code><a href=#history-0>History</a></code> interface
- are defined in terms of the <code title=dom-history-go><a href=#dom-history-go>go()</a></code>
- method, as follows:</p>
-
- <table><tr><th>Member</th>
- <th>Definition</th>
- <tr><td><dfn id=dom-history-back title=dom-history-back><code>back()</code></dfn></td>
- <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><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 entry to
+ <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 entry to
the history.</p>
<p>The <dfn id=dom-history-replacestate title=dom-history-replaceState><code>replaceState(<var title="">data</var>, <var title="">title</var>, <var title="">url</var>)</code></dfn> method updates the state object,
@@ -55925,12 +55938,12 @@
<li>If the <a href=#origin>origin</a> of the resulting <a href=#absolute-url>absolute
URL</a> is not the same as the <a href=#origin>origin</a> of the
- <a href=#entry-script>entry script</a>'s <code title="script's browsing
- context"><a href="#script's-browsing-context">browsing context, and either the <span title=url-path><path></span> or <span title=url-query><query></span> components of the two
- <span title=URL>URLs</span> comparedi in the previous step
- differ, raise a <code>SECURITY_ERR</code> exception and abort
+ <a href=#entry-script>entry script</a>'s <a href="#script's-browsing-context" title="script's browsing
+ context">browsing context</a>, and either the <a href=#url-path title=url-path><path></a> or <a href=#url-query title=url-query><query></a> components of the two
+ <a href=#url title=URL>URLs</a> comparedi in the previous step
+ differ, raise a <code><a href=#security_err>SECURITY_ERR</a></code> exception and abort
these steps. (This prevents sandboxed content from spoofing other
- pages on the same origin.)</a></code></li>
+ pages on the same origin.)</li>
</ol><p>For the purposes of the comparisons in the above substeps, the
<a href=#url-path title=url-path><path></a> and <a href=#url-query title=url-query><query></a> components can only be the
@@ -55956,6 +55969,9 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a> queued
+ by the <a href=#history-traversal-task-source>history traversal task source</a>.</li>
+
<li><p>Add a state object entry to the session history, after the
<a href=#current-entry>current entry</a>, with <var title="">cloned data</var> as
the state object, the given <var title="">title</var> as the title,
@@ -55985,7 +56001,7 @@
<p class=note>Since this is neither a <a href=#navigate title=navigate>navigation</a> of the <a href=#browsing-context>browsing
context</a> nor a <a href=#traverse-the-history title="traverse the history">history
- traversal</a>, it does not cause a <code title=event-hashchange>hashchange</code> event to be fired.</p>
+ traversal</a>, it does not cause a <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> event to be fired.</p>
</li>
@@ -56100,78 +56116,8 @@
- <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>
+ <h4 id=the-location-interface><span class=secno>6.10.3 </span>The <code><a href=#location>Location</a></code> interface</h4>
- <div class=impl>
-
- <p>When an entry in the session history is activated (which happens
- during <a href=#traverse-the-history title="traverse the history">session history
- traversal</a>), the user agent must run the following steps:</p>
-
- <ol><!-- only called for the first entry of a Document set and for
- state object entries, not for frag id change entries --><li><p>If the entry is a <a href=#state-object>state object</a> entry, let <var title="">state</var> be a <a href=#structured-clone>structured clone</a> of that
- state object. Otherwise, let <var title="">state</var> be
- null.</li>
-
- <li>
-
- <p>Run the appropriate steps according to the conditions
- described:</p>
-
- <dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
- string "complete"</dt>
-
- <dd><p>Synchronously fire a <dfn id=event-popstate title=event-popstate><code>popstate</code></dfn> event on the
- <code><a href=#window>Window</a></code> object of the <code>Document</code>, using
- the <code><a href=#popstateevent>PopStateEvent</a></code> interface, with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code> attribute set to the
- value of <var title="">state</var>. This event must bubble but
- not be cancelable and has no default action.</dd>
-
- <dt>Otherwise</dt>
-
- <dd><p>Let the <code>Document</code>'s <dfn id=pending-state-object>pending state
- object</dfn> be <var title="">state</var>. (If there was already
- a <a href=#pending-state-object>pending state object</a>, the previous one is
- discarded.)</p>
-
- <p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>
-
- </dl></li>
-
- </ol><p>The <a href=#pending-state-object>pending state object</a> must be initially null.</p>
-
- <hr></div>
-
- <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);
-};</pre>
-
- <dl class=domintro><dt><var title="">event</var> . <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code></dt>
-
- <dd>
-
- <p>Returns the information that was provided to <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> or <code title=dom-history-replaceState><a href=#dom-history-replacestate>replaceState()</a></code>.</p>
-
- </dd>
-
- </dl><div class=impl>
-
- <p>The <dfn id=dom-popstateevent-initpopstateevent title=dom-PopStateEvent-initPopStateEvent><code>initPopStateEvent()</code></dfn>
- method must initialize the event in a manner analogous to the
- similarly-named method in the DOM Events interfaces. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
-
- <p>The <dfn id=dom-popstateevent-state title=dom-PopStateEvent-state><code>state</code></dfn>
- attribute represents the context information for the event, or null,
- if the state represented is the initial state of the
- <code>Document</code>.</p>
-
- </div>
-
-
-
- <h4 id=the-location-interface><span class=secno>6.10.4 </span>The <code><a href=#location>Location</a></code> interface</h4>
-
<p>Each <code>Document</code> object in a <a href=#browsing-context>browsing
context</a>'s session history is associated with a unique
instance of a <code><a href=#location>Location</a></code> object.</p>
@@ -56378,7 +56324,7 @@
<div class=impl>
- <h5 id=security-3><span class=secno>6.10.4.1 </span>Security</h5>
+ <h5 id=security-3><span class=secno>6.10.3.1 </span>Security</h5>
<p>User agents must raise a <code><a href=#security_err>SECURITY_ERR</a></code> exception whenever
any of the members of a <code><a href=#location>Location</a></code> object are accessed by
@@ -56401,7 +56347,7 @@
<div class=impl>
- <h4 id=history-notes><span class=secno>6.10.5 </span>Implementation notes for session history</h4>
+ <h4 id=history-notes><span class=secno>6.10.4 </span>Implementation notes for session history</h4>
<!-- don't change the ID without updating multiple internal links -->
<p><i>This section is non-normative.</i></p>
@@ -56839,6 +56785,12 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a>
+ queued by the <a href=#history-traversal-task-source>history traversal task
+ source</a>.</li> <!-- so the network is racing
+ history.back(), in the case of setting location.href="" and
+ then calling history.back() -->
+
<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its
<code>Document</code> object and related state.</li>
@@ -57126,6 +57078,9 @@
</li>
+ <li><p>Remove any <a href=#concept-task title=concept-task>tasks</a> queued by
+ the <a href=#history-traversal-task-source>history traversal task source</a>.</li>
+
<li><p>Append a new entry at the end of the <code><a href=#history-0>History</a></code>
object representing the new resource and its <code>Document</code>
object and related state. Its <a href=#url>URL</a> must be set to the
@@ -57196,9 +57151,14 @@
document</a>, if that is an element; otherwise there is no
<i><a href=#target-element>target element</a></i>. <a href=#refsSELECTORS>[SELECTORS]</a></p>
+ </div>
- <h4 id=history-traversal><span class=secno>6.11.9 </span>History traversal</h4>
+
+ <h4 id=history-traversal><span class=secno>6.11.9 </span>History traversal</h4> <!-- session history -->
+
+ <div class=impl>
+
<p>When a user agent is required to <dfn id=traverse-the-history>traverse the history</dfn>
to a <i>specified entry</i>, optionally with <a href=#replacement-enabled>replacement
enabled</a>, the user agent must act as follows:</p>
@@ -57215,8 +57175,6 @@
created. (This can never happen with <a href=#replacement-enabled>replacement
enabled</a>.)</li>
- <li><p>Release the <a href=#storage-mutex>storage mutex</a>.</li>
-
<li><p>If the <a href=#current-entry>current entry</a>'s title was not set by the
<code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> or <code title=dom-history-replaceState><a href=#dom-history-replacestate>replaceState()</a></code> methods,
then set its title to the value returned by the <code title=dom-document-title><a href=#document.title>document.title</a></code> IDL
@@ -57297,7 +57255,10 @@
<li><p>If the <i>specified entry</i> has a URL that differs from
the <a href=#current-entry>current entry</a>'s only by its fragment identifier,
and the two share the same <code>Document</code> object, then let
- <var title="">hash changed</var> be true. Otherwise, let <var title="">hash changed</var> be false.</li>
+ <var title="">hash changed</var> be true, and let <var title="">old
+ URL</var> be the URL of the <a href=#current-entry>current entry</a> and <var title="">new URL</var> be the URL of the <i>specified
+ entry</i>. Otherwise, let <var title="">hash changed</var> be
+ false.</li>
<li><p>If the traversal was initiated with <dfn id=replacement-enabled>replacement
enabled</dfn>, remove the entry immediately before the
@@ -57312,22 +57273,144 @@
view, for instance the scroll position or values of form fields,
that it had previously recorded.</li>
- <li><p>If the <i>specified entry</i> is a state object or the
- first entry for a <code>Document</code>, the user agent must <a href=#activating-state-object-entries title="activate the state object">activate that
- entry</a>.</li>
+ <li>
+ <p>If the <i>specified entry</i> is a state object or the first
+ entry for a <code>Document</code>, the user agent must run the
+ following substeps:</p>
+
+ <ol><li><p>If the entry is a <a href=#state-object>state object</a> entry, let <var title="">state</var> be a <a href=#structured-clone>structured clone</a> of that
+ state object. Otherwise, let <var title="">state</var> be
+ null.</li>
+
+ <li>
+
+ <p>Run the appropriate steps according to the conditions
+ described:</p>
+
+ <dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
+ string "complete"</dt>
+
+ <dd><p><a href=#queue-a-task>Queue a task</a> to fire a <code title=event-popstate><a href=#event-popstate>popstate</a></code> event at the
+ <code><a href=#window>Window</a></code> object of the <code>Document</code>, using
+ the <code><a href=#popstateevent>PopStateEvent</a></code> interface, with the <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code> attribute set to
+ the value of <var title="">state</var>. This event must bubble
+ but not be cancelable and has no default action.</dd>
+
+ <dt>Otherwise</dt>
+
+ <dd><p>Let the <code>Document</code>'s <dfn id=pending-state-object>pending state
+ object</dfn> be <var title="">state</var>. (If there was already
+ a <a href=#pending-state-object>pending state object</a>, the previous one is
+ discarded.)</p>
+
+ <p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>
+
+ </dl></li>
+
+ </ol></li>
+
<li><p>If <var title="">hash changed</var> is true, then
- synchronously <a href=#fire-a-simple-event>fire a simple event</a> with the name <code title=event-hashchange>hashchange</code> at the <a href=#browsing-context>browsing
- context</a>'s <code><a href=#window>Window</a></code> object.</li>
+ <a href=#queue-a-task>queue a task</a> to fire a <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> event at the
+ <a href=#browsing-context>browsing context</a>'s <code><a href=#window>Window</a></code> object, using
+ the <code><a href=#hashchangeevent>HashChangeEvent</a></code> interface, with the <code title=dom-HashChangeEvent-oldURL><a href=#dom-hashchangeevent-oldurl>oldURL</a></code> attribute set to
+ <var title="">old URL</var> and the <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code> attribute set to
+ <var title="">new URL</var>. This event must bubble but not be
+ cancelable and has no default action.</li>
- <li><p>Release the <a href=#storage-mutex>storage mutex</a> again.</li>
-
<li><p>The <a href=#current-entry>current entry</a> is now the <i>specified
entry</i>.</li>
- </ol></div>
+ </ol><p>The <a href=#pending-state-object>pending state object</a> must be initially null.</p>
+ <p>The <a href=#task-source>task source</a> for the tasks mentioned above is the
+ <a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>
+
+ <h5 id=event-definitions><span class=secno>6.11.9.1 </span>Event definitions</h5>
+
+ </div>
+
+ <p>The <dfn id=event-popstate title=event-popstate><code>popstate</code></dfn> event
+ is fired when navigating to a <a href=#session-history-entry>session history entry</a>
+ that represents a state object.</p>
+
+ <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);
+};</pre>
+
+ <dl class=domintro><dt><var title="">event</var> . <code title=dom-PopStateEvent-state><a href=#dom-popstateevent-state>state</a></code></dt>
+
+ <dd>
+
+ <p>Returns the information that was provided to <code title=dom-history-pushState><a href=#dom-history-pushstate>pushState()</a></code> or <code title=dom-history-replaceState><a href=#dom-history-replacestate>replaceState()</a></code>.</p>
+
+ </dd>
+
+ </dl><div class=impl>
+
+ <p>The <dfn id=dom-popstateevent-initpopstateevent title=dom-PopStateEvent-initPopStateEvent><code>initPopStateEvent()</code></dfn>
+ method must initialize the event in a manner analogous to the
+ similarly-named method in the DOM Events interfaces. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
+
+ <p>The <dfn id=dom-popstateevent-state title=dom-PopStateEvent-state><code>state</code></dfn>
+ attribute represents the context information for the event, or null,
+ if the state represented is the initial state of the
+ <code>Document</code>.</p>
+
+ </div>
+
+ <hr><p>The <dfn id=event-hashchange title=event-hashchange><code>hashchange</code></dfn>
+ event is fired when navigating to a <a href=#session-history-entry>session history
+ entry</a> whose <a href=#url>URL</a> differs from that of the
+ previous one only in the fragment identifier.</p>
+
+ <pre class=idl>interface <dfn id=hashchangeevent>HashChangeEvent</dfn> : Event {
+ readonly attribute any <a href=#dom-hashchangeevent-oldurl title=dom-HashChangeEvent-oldURL>oldURL</a>;
+ readonly attribute any <a href=#dom-hashchangeevent-newurl title=dom-HashChangeEvent-newURL>newURL</a>;
+ void <a href=#dom-hashchangeevent-inithashchangeevent title=dom-HashChangeEvent-initHashChangeEvent>initHashChangeEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString oldURLArg, in DOMString newURLArg);
+};</pre>
+
+ <dl class=domintro><dt><var title="">event</var> . <code title=dom-HashChangeEvent-oldURL><a href=#dom-hashchangeevent-oldurl>oldURL</a></code></dt>
+
+ <dd>
+
+ <p>Returns the <a href=#url>URL</a> of the <a href=#session-history-entry>session history
+ entry</a> that was previously current.</p>
+
+ </dd>
+
+
+ <dt><var title="">event</var> . <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code></dt>
+
+ <dd>
+
+ <p>Returns the <a href=#url>URL</a> of the <a href=#session-history-entry>session history
+ entry</a> that is now current.</p>
+
+ </dd>
+
+ </dl><div class=impl>
+
+ <p>The <dfn id=dom-hashchangeevent-inithashchangeevent title=dom-HashChangeEvent-initHashChangeEvent><code>initHashChangeEvent()</code></dfn>
+ method must initialize the event in a manner analogous to the
+ similarly-named method in the DOM Events interfaces. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
+
+ <p>The <dfn id=dom-hashchangeevent-oldurl title=dom-HashChangeEvent-oldURL><code>oldURL</code></dfn>
+ attribute represents context information for the event, specifically
+ the URL of the <a href=#session-history-entry>session history entry</a> that was traversed
+ from.</p>
+
+ <p>The <dfn id=dom-hashchangeevent-newurl title=dom-HashChangeEvent-newURL><code>newURL</code></dfn>
+ attribute represents context information for the event, specifically
+ the URL of the <a href=#session-history-entry>session history entry</a> that was traversed
+ to.</p>
+
+ </div>
+
+
+
<h4 id=unloading-documents><span class=secno>6.11.10 </span>Unloading documents</h4>
<div class=impl>
@@ -57502,6 +57585,8 @@
</div>
+ <div class=impl>
+
<h4 id=aborting-a-document-load><span class=secno>6.11.11 </span>Aborting a document load</h4>
<p>If the user cancels any instance of the <a href=#fetch title=fetch>fetching algorithm</a> in the context of a
@@ -57514,8 +57599,10 @@
<!-- I'd love to make this more precise, anyone have any suggestions
on what it should say? -->
+ </div>
+
<h3 id=links><span class=secno>6.12 </span>Links</h3>
@@ -62659,7 +62746,7 @@
- <h3 id=event-definitions><span class=secno>8.1 </span>Event definitions</h3>
+ <h3 id=event-definitions-0><span class=secno>8.1 </span>Event definitions</h3>
<p>Messages in <span>server-sent events</span>, <span>Web
sockets</span>, <a href=#crossDocumentMessages>cross-document messaging</a>, and
@@ -80776,7 +80863,7 @@
<tr><th> <code title="">onhashchange</code>
<td> <code title=handler-window-onhashchange><a href=#handler-window-onhashchange>body</a></code>
- <td> <code title=event-hashchange>hashchange</code> event handler for <code><a href=#window>Window</a></code> object
+ <td> <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> event handler for <code><a href=#window>Window</a></code> object
<td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
<tr><th> <code title="">oninput</code>
@@ -81369,8 +81456,8 @@
<td> <code>Event</code>
<td> Fired at form controls when the user changes the value of a control on the form
- <tr><td> <code title=event-hashchange>hashchange</code>
- <td> <code>Event</code>
+ <tr><td> <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code>
+ <td> <code><a href=#hashchangeevent>HashChangeEvent</a></code>
<td> Fired at the <code><a href=#window>Window</a></code> when the fragment identifier part of <a href="#the-document's-current-address">the document's current address</a> changes
<tr><td> <code title=event-input>input</code>
Modified: source
===================================================================
--- source 2010-01-28 01:22:24 UTC (rev 4631)
+++ source 2010-01-29 01:31:38 UTC (rev 4632)
@@ -10107,22 +10107,21 @@
</li>
+ <li><p>Remove any <span title="concept-task">tasks</span> queued by
+ the <span>history traversal task source</span>.</p></li>
+
<li>Remove any earlier entries that share the same
<code>Document</code>.</li>
- <li>
+ <li><p>If <var title="">replace</var> is false, then add a new
+ entry, just before the last entry, and associate with the new entry
+ the text that was parsed by the previous parser associated with the
+ <code>Document</code> object, as well as the state of the document
+ at the start of these steps. (This allows the user to step
+ backwards in the session history to see the page before it was
+ blown away by the <code
+ title="dom-document-open">document.open()</code> call.)</p></li>
- <p>If <var title="">replace</var> is false, then add a new entry,
- just before the last entry, and assocaite with the new entry the
- text that was parsed by the previous parser associated with the
- <code>Document</code> object, as well as the state of the document
- at the start of these steps. (This allows the user to step
- backwards in the session history to see the page before it was
- blown away by the <code
- title="dom-document-open">document.open()</code> call.)</p>
-
- </li>
-
<li><p>Finally, set the <span>insertion point</span> to point at
just before the end of the <span>input stream</span> (which at this
point will be empty).</p></li>
@@ -21997,8 +21996,10 @@
its <code title="attr-object-type">type</code> attribute is set,
changed, or removed: the user agent must <span>queue a task</span>
to run the following steps to (re)determine what the
- <code>object</code> element represents:</p>
- <!-- Changing the base URL doesn't trigger this. -->
+ <code>object</code> element represents. The <span>task source</span>
+ for this <span title="concept-task">task</span> is the <span>DOM
+ manipulation task source</span>.</p> <!-- Changing the base URL
+ doesn't trigger this. -->
<ol>
@@ -22386,10 +22387,6 @@
</ol>
- <p>The <span>task source</span> for the <span
- title="concept-task">task</span> above is the <span>DOM manipulation
- task source</span>.</p>
-
<p id="object-plugin">When the algorithm above instantiates a
<span>plugin</span>, the user agent should pass the names and values
of all the attributes on the element, and <!-- then a parameter
@@ -58520,6 +58517,16 @@
</dd>
+ <dt>The <dfn>history traversal task source</dfn></dt>
+
+ <dd>
+
+ <p>This <span>task source</span> is used to queue calls to <code
+ title="dom-history-back">history.back()</code> and similar
+ APIs.</p>
+
+ </dd>
+
</dl>
</div>
@@ -63189,17 +63196,31 @@
<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 run the
- following steps:</p>
+ <p>When the <dfn title="dom-history-go"><code>go(<var
+ title="">delta</var>)</code></dfn> method is invoked, if the
+ argument to the method was omitted or has the value zero, the user
+ agent must act as if the <code
+ title="dom-location-reload">location.reload()</code> method was
+ called instead. Otherwise, the user agent must <span>traverse the
+ history by a delta</span> whose value is the value of the method's
+ argument.</p>
+ <p>When the <dfn title="dom-history-back"><code>back()</code></dfn>
+ method is invoked, the user agent must <span>traverse the history by
+ a delta</span> −1.</p>
+
+ <p>When the <dfn
+ title="dom-history-forward"><code>forward()</code></dfn>method is
+ invoked, the user agent must <span>traverse the history by a
+ delta</span> +1.</p>
+
+ <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>
+
<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">location.reload()</code> method was
- called instead, and abort these steps.</p>
-
<li><p>Let <var title="">delta</var> be the argument to the
method.</p></li>
@@ -63217,6 +63238,9 @@
<span>browsing context</span> of the <var title="">specified
entry</var>.</p></li>
+ <!-- XXX if going to another doc, try to unload the document here
+ (firing beforeunload, unload, pagehide) -->
+
<li><p><span>Traverse the history</span> of the <var
title="">specified browsing context</var> to the <var
title="">specified entry</var>.</p>
@@ -63225,30 +63249,9 @@
<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
- title="dom-history-go">history.go(<var title="">delta</var>)</code>
- method on the various affected <code
- title="dom-window">window</code> objects.</p>
+ <span>traverse the history by a delta</span> equivalent to the
+ action specified by the user.</p>
- <p>Some of the other members of the <code>History</code> interface
- are defined in terms of the <code title="dom-history-go">go()</code>
- method, as follows:</p>
-
- <table>
- <tr>
- <th>Member</th>
- <th>Definition</th>
- </tr>
- <tr>
- <td><dfn title="dom-history-back"><code>back()</code></dfn></td>
- <td>Must do the same as <code title="dom-history-go">go(-1)</code></td>
- </tr>
- <tr>
- <td><dfn title="dom-history-forward"><code>forward()</code></dfn></td>
- <td>Must do the same as <code title="dom-history-go">go(1)</code></td>
- </tr>
- </table>
-
<hr>
<p>The <dfn title="dom-history-pushState"><code>pushState(<var
@@ -63296,7 +63299,7 @@
<li>If the <span>origin</span> of the resulting <span>absolute
URL</span> is not the same as the <span>origin</span> of the
- <span>entry script</span>'s <code title="script's browsing
+ <span>entry script</span>'s <span title="script's browsing
context">browsing context</span>, and either the <span
title="url-path"><path></span> or <span
title="url-query"><query></span> components of the two
@@ -63336,6 +63339,9 @@
</li>
+ <li><p>Remove any <span title="concept-task">tasks</span> queued
+ by the <span>history traversal task source</span>.</p></li>
+
<li><p>Add a state object entry to the session history, after the
<span>current entry</span>, with <var title="">cloned data</var> as
the state object, the given <var title="">title</var> as the title,
@@ -63491,98 +63497,6 @@
- <h4><dfn title="activate the state object">Activating state object entries</dfn></h4>
-
- <div class="impl">
-
- <p>When an entry in the session history is activated (which happens
- during <span title="traverse the history">session history
- traversal</span>), the user agent must run the following steps:</p>
-
- <ol><!-- only called for the first entry of a Document set and for
- state object entries, not for frag id change entries -->
-
- <li><p>If the entry is a <span>state object</span> entry, let <var
- title="">state</var> be a <span>structured clone</span> of that
- state object. Otherwise, let <var title="">state</var> be
- null.</p></li>
-
- <li>
-
- <p>Run the appropriate steps according to the conditions
- described:</p>
-
- <dl class="switch">
-
- <dt>If the <span>current document readiness</span> is set to the
- string "complete"</dt>
-
- <dd><p>Synchronously fire a <dfn
- title="event-popstate"><code>popstate</code></dfn> event on the
- <code>Window</code> object of the <code>Document</code>, using
- the <code>PopStateEvent</code> interface, with the <code
- title="dom-PopStateEvent-state">state</code> attribute set to the
- value of <var title="">state</var>. This event must bubble but
- not be cancelable and has no default action.</p></dd>
-
- <dt>Otherwise</dt>
-
- <dd><p>Let the <code>Document</code>'s <dfn>pending state
- object</dfn> be <var title="">state</var>. (If there was already
- a <span>pending state object</span>, the previous one is
- discarded.)</p>
-
- <p class="note">The event will then be fired just after the <code
- title="event-load">load</code> event.</p></dd>
-
- </dl>
-
- </li>
-
- </ol>
-
- <p>The <span>pending state object</span> must be initially null.</p>
-
- <hr>
-
- </div>
-
- <pre class="idl">interface <dfn>PopStateEvent</dfn> : Event {
- readonly attribute any <span title="dom-PopStateEvent-state">state</span>;
- void <span title="dom-PopStateEvent-initPopStateEvent">initPopStateEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
-};</pre>
-
- <dl class="domintro">
-
- <dt><var title="">event</var> . <code title="dom-PopStateEvent-state">state</code></dt>
-
- <dd>
-
- <p>Returns the information that was provided to <code
- title="dom-history-pushState">pushState()</code> or <code
- title="dom-history-replaceState">replaceState()</code>.</p>
-
- </dd>
-
- </dl>
-
- <div class="impl">
-
- <p>The <dfn
- title="dom-PopStateEvent-initPopStateEvent"><code>initPopStateEvent()</code></dfn>
- method must initialize the event in a manner analogous to the
- similarly-named method in the DOM Events interfaces. <a
- href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
-
- <p>The <dfn title="dom-PopStateEvent-state"><code>state</code></dfn>
- attribute represents the context information for the event, or null,
- if the state represented is the initial state of the
- <code>Document</code>.</p>
-
- </div>
-
-
-
<h4>The <code>Location</code> interface</h4>
<p>Each <code>Document</code> object in a <span>browsing
@@ -64352,6 +64266,12 @@
</li>
+ <li><p>Remove any <span title="concept-task">tasks</span>
+ queued by the <span>history traversal task
+ source</span>.</p></li> <!-- so the network is racing
+ history.back(), in the case of setting location.href="" and
+ then calling history.back() -->
+
<li><p>Append a new entry at the end of the <code>History</code>
object representing the new resource and its
<code>Document</code> object and related state.</p></li>
@@ -64670,6 +64590,9 @@
</li>
+ <li><p>Remove any <span title="concept-task">tasks</span> queued by
+ the <span>history traversal task source</span>.</p></li>
+
<li><p>Append a new entry at the end of the <code>History</code>
object representing the new resource and its <code>Document</code>
object and related state. Its <span>URL</span> must be set to the
@@ -64755,9 +64678,14 @@
document</span>, if that is an element; otherwise there is no
<i>target element</i>. <a href="#refsSELECTORS">[SELECTORS]</a></p>
+ </div>
- <h4>History traversal</h4>
+
+ <h4>History traversal</h4> <!-- session history -->
+
+ <div class="impl">
+
<p>When a user agent is required to <dfn>traverse the history</dfn>
to a <i>specified entry</i>, optionally with <span>replacement
enabled</span>, the user agent must act as follows:</p>
@@ -64776,8 +64704,6 @@
created. (This can never happen with <span>replacement
enabled</span>.)</p></li>
- <li><p>Release the <span>storage mutex</span>.</p></li>
-
<li><p>If the <span>current entry</span>'s title was not set by the
<code title="dom-history-pushState">pushState()</code> or <code
title="dom-history-replaceState">replaceState()</code> methods,
@@ -64874,8 +64800,11 @@
<li><p>If the <i>specified entry</i> has a URL that differs from
the <span>current entry</span>'s only by its fragment identifier,
and the two share the same <code>Document</code> object, then let
- <var title="">hash changed</var> be true. Otherwise, let <var
- title="">hash changed</var> be false.</p></li>
+ <var title="">hash changed</var> be true, and let <var title="">old
+ URL</var> be the URL of the <span>current entry</span> and <var
+ title="">new URL</var> be the URL of the <i>specified
+ entry</i>. Otherwise, let <var title="">hash changed</var> be
+ false.</p></li>
<li><p>If the traversal was initiated with <dfn>replacement
enabled</dfn>, remove the entry immediately before the
@@ -64890,26 +64819,179 @@
view, for instance the scroll position or values of form fields,
that it had previously recorded.</p></li>
- <li><p>If the <i>specified entry</i> is a state object or the
- first entry for a <code>Document</code>, the user agent must <span
- title="activate the state object">activate that
- entry</span>.</p></li>
+ <li>
+ <p>If the <i>specified entry</i> is a state object or the first
+ entry for a <code>Document</code>, the user agent must run the
+ following substeps:</p>
+
+ <ol>
+
+ <li><p>If the entry is a <span>state object</span> entry, let <var
+ title="">state</var> be a <span>structured clone</span> of that
+ state object. Otherwise, let <var title="">state</var> be
+ null.</p></li>
+
+ <li>
+
+ <p>Run the appropriate steps according to the conditions
+ described:</p>
+
+ <dl class="switch">
+
+ <dt>If the <span>current document readiness</span> is set to the
+ string "complete"</dt>
+
+ <dd><p><span>Queue a task</span> to fire a <code
+ title="event-popstate">popstate</code> event at the
+ <code>Window</code> object of the <code>Document</code>, using
+ the <code>PopStateEvent</code> interface, with the <code
+ title="dom-PopStateEvent-state">state</code> attribute set to
+ the value of <var title="">state</var>. This event must bubble
+ but not be cancelable and has no default action.</p></dd>
+
+ <dt>Otherwise</dt>
+
+ <dd><p>Let the <code>Document</code>'s <dfn>pending state
+ object</dfn> be <var title="">state</var>. (If there was already
+ a <span>pending state object</span>, the previous one is
+ discarded.)</p>
+
+ <p class="note">The event will then be fired just after the <code
+ title="event-load">load</code> event.</p></dd>
+
+ </dl>
+
+ </li>
+
+ </ol>
+
+ </li>
+
<li><p>If <var title="">hash changed</var> is true, then
- synchronously <span>fire a simple event</span> with the name <code
- title="event-hashchange">hashchange</code> at the <span>browsing
- context</span>'s <code>Window</code> object.</p></li>
+ <span>queue a task</span> to fire a <code
+ title="event-hashchange">hashchange</code> event at the
+ <span>browsing context</span>'s <code>Window</code> object, using
+ the <code>HashChangeEvent</code> interface, with the <code
+ title="dom-HashChangeEvent-oldURL">oldURL</code> attribute set to
+ <var title="">old URL</var> and the <code
+ title="dom-HashChangeEvent-newURL">newURL</code> attribute set to
+ <var title="">new URL</var>. This event must bubble but not be
+ cancelable and has no default action.</p></li>
- <li><p>Release the <span>storage mutex</span> again.</p></li>
-
<li><p>The <span>current entry</span> is now the <i>specified
entry</i>.</p></li>
</ol>
+ <p>The <span>pending state object</span> must be initially null.</p>
+
+ <p>The <span>task source</span> for the tasks mentioned above is the
+ <span>DOM manipulation task source</span>.</p>
+
+
+ <h5>Event definitions</h5>
+
</div>
+ <p>The <dfn title="event-popstate"><code>popstate</code></dfn> event
+ is fired when navigating to a <span>session history entry</span>
+ that represents a state object.</p>
+ <pre class="idl">interface <dfn>PopStateEvent</dfn> : Event {
+ readonly attribute any <span title="dom-PopStateEvent-state">state</span>;
+ void <span title="dom-PopStateEvent-initPopStateEvent">initPopStateEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
+};</pre>
+
+ <dl class="domintro">
+
+ <dt><var title="">event</var> . <code title="dom-PopStateEvent-state">state</code></dt>
+
+ <dd>
+
+ <p>Returns the information that was provided to <code
+ title="dom-history-pushState">pushState()</code> or <code
+ title="dom-history-replaceState">replaceState()</code>.</p>
+
+ </dd>
+
+ </dl>
+
+ <div class="impl">
+
+ <p>The <dfn
+ title="dom-PopStateEvent-initPopStateEvent"><code>initPopStateEvent()</code></dfn>
+ method must initialize the event in a manner analogous to the
+ similarly-named method in the DOM Events interfaces. <a
+ href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
+
+ <p>The <dfn title="dom-PopStateEvent-state"><code>state</code></dfn>
+ attribute represents the context information for the event, or null,
+ if the state represented is the initial state of the
+ <code>Document</code>.</p>
+
+ </div>
+
+ <hr>
+
+ <p>The <dfn title="event-hashchange"><code>hashchange</code></dfn>
+ event is fired when navigating to a <span>session history
+ entry</span> whose <span>URL</span> differs from that of the
+ previous one only in the fragment identifier.</p>
+
+ <pre class="idl">interface <dfn>HashChangeEvent</dfn> : Event {
+ readonly attribute any <span title="dom-HashChangeEvent-oldURL">oldURL</span>;
+ readonly attribute any <span title="dom-HashChangeEvent-newURL">newURL</span>;
+ void <span title="dom-HashChangeEvent-initHashChangeEvent">initHashChangeEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString oldURLArg, in DOMString newURLArg);
+};</pre>
+
+ <dl class="domintro">
+
+ <dt><var title="">event</var> . <code title="dom-HashChangeEvent-oldURL">oldURL</code></dt>
+
+ <dd>
+
+ <p>Returns the <span>URL</span> of the <span>session history
+ entry</span> that was previously current.</p>
+
+ </dd>
+
+
+ <dt><var title="">event</var> . <code title="dom-HashChangeEvent-newURL">newURL</code></dt>
+
+ <dd>
+
+ <p>Returns the <span>URL</span> of the <span>session history
+ entry</span> that is now current.</p>
+
+ </dd>
+
+ </dl>
+
+ <div class="impl">
+
+ <p>The <dfn
+ title="dom-HashChangeEvent-initHashChangeEvent"><code>initHashChangeEvent()</code></dfn>
+ method must initialize the event in a manner analogous to the
+ similarly-named method in the DOM Events interfaces. <a
+ href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
+
+ <p>The <dfn
+ title="dom-HashChangeEvent-oldURL"><code>oldURL</code></dfn>
+ attribute represents context information for the event, specifically
+ the URL of the <span>session history entry</span> that was traversed
+ from.</p>
+
+ <p>The <dfn
+ title="dom-HashChangeEvent-newURL"><code>newURL</code></dfn>
+ attribute represents context information for the event, specifically
+ the URL of the <span>session history entry</span> that was traversed
+ to.</p>
+
+ </div>
+
+
+
<h4>Unloading documents</h4>
<div class="impl">
@@ -65125,6 +65207,8 @@
</div>
+ <div class="impl">
+
<h4>Aborting a document load</h4>
<p>If the user cancels any instance of the <span
@@ -65138,8 +65222,10 @@
<!-- I'd love to make this more precise, anyone have any suggestions
on what it should say? -->
+ </div>
+
<h3 id="links">Links</h3>
@@ -97235,7 +97321,7 @@
<tr>
<td> <code title="event-hashchange">hashchange</code>
- <td> <code>Event</code>
+ <td> <code>HashChangeEvent</code>
<td> Fired at the <code>Window</code> when the fragment identifier part of <span>the document's current address</span> changes
<tr>
More information about the Commit-Watchers
mailing list