<h2 class="no-num no-toc">Living Standard — Last Updated 24 March 2011</h2>
<h2 class="no-num no-toc">Living Standard — Last Updated 25 March 2011</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>-->
state object. Otherwise, let <var title="">state</var> be
null.</li>
<li>
<p>Run the appropriate steps according to the conditions
described:</p>
<li><p>Set <code title=dom-history-state><a href=#dom-history-state>history.state</a></code> to <var title="">state</var>.</li>
<dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
string "complete"</dt>
<li><p>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><a href=#document>Document</a></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.</li>
<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><a href=#document>Document</a></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><a href=#document>Document</a></code>'s <a href=#pending-state-object>pending state
object</a> 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>
<li><p>If <var title="">hash changed</var> is true, then
<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
<li><p>If <var title="">hash changed</var> is true, then 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
<li><p>The <a href=#current-entry>current entry</a> is now the <i>specified
entry</i>.</li>
</ol><p>The <dfn id=pending-state-object>pending state object</dfn> is used to keep track of what
state object to use in the inital <code title=event-popstate><a href=#event-popstate>popstate</a></code> event fired by the parser
once it <a href=#stop-parsing title="stop parsing">stops parsing</a>. 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
</ol><p>The <a href=#task-source>task source</a> for the tasks mentioned above is the
attribute set to false. This event must not bubble, must not be
cancelable, and has no default action.</li>
<li><p>If the <code><a href=#document>Document</a></code> is in a <a href=#browsing-context>browsing
context</a>, then <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=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object 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
current value of the <a href=#pending-state-object>pending state object</a>. This event
must bubble but not be cancelable and has no default
action.</li>
<li><p>If the <code><a href=#document>Document</a></code> has any <a href=#pending-application-cache-download-process-tasks>pending
application cache download process tasks</a>, then <a href=#queue-a-task title="queue a task">queue</a> each such <a href=#concept-task title=concept-task>task</a> in the order they were added to
the list of <a href=#pending-application-cache-download-process-tasks>pending application cache download process
<h2 class="no-num no-toc">Living Standard — Last Updated 24 March 2011</h2>
<h2 class="no-num no-toc">Living Standard — Last Updated 25 March 2011</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>-->
state object. Otherwise, let <var title="">state</var> be
null.</li>
<li>
<p>Run the appropriate steps according to the conditions
described:</p>
<li><p>Set <code title=dom-history-state><a href=#dom-history-state>history.state</a></code> to <var title="">state</var>.</li>
<dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
string "complete"</dt>
<li><p>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><a href=#document>Document</a></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.</li>
<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><a href=#document>Document</a></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><a href=#document>Document</a></code>'s <a href=#pending-state-object>pending state
object</a> 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>
<li><p>If <var title="">hash changed</var> is true, then
<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
<li><p>If <var title="">hash changed</var> is true, then 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
<li><p>The <a href=#current-entry>current entry</a> is now the <i>specified
entry</i>.</li>
</ol><p>The <dfn id=pending-state-object>pending state object</dfn> is used to keep track of what
state object to use in the inital <code title=event-popstate><a href=#event-popstate>popstate</a></code> event fired by the parser
once it <a href=#stop-parsing title="stop parsing">stops parsing</a>. 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
</ol><p>The <a href=#task-source>task source</a> for the tasks mentioned above is the
attribute set to false. This event must not bubble, must not be
cancelable, and has no default action.</li>
<li><p>If the <code><a href=#document>Document</a></code> is in a <a href=#browsing-context>browsing
context</a>, then <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=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object 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
current value of the <a href=#pending-state-object>pending state object</a>. This event
must bubble but not be cancelable and has no default
action.</li>
<li><p>If the <code><a href=#document>Document</a></code> has any <a href=#pending-application-cache-download-process-tasks>pending
application cache download process tasks</a>, then <a href=#queue-a-task title="queue a task">queue</a> each such <a href=#concept-task title=concept-task>task</a> in the order they were added to
the list of <a href=#pending-application-cache-download-process-tasks>pending application cache download process