Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (1) Make popstate fire even when there's no new state
git-svn-id: http://svn.whatwg.org/webapps@5377 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 27, 2010
1 parent bda43cc commit ed5a13f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 93 deletions.
48 changes: 20 additions & 28 deletions complete.html
Expand Up @@ -61257,42 +61257,34 @@ <h4 id=history-traversal><span class=secno>6.5.9 </span>History traversal</h4> <
its rendering, 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><a href=#document>Document</a></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>
<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>

<p>Run the appropriate steps according to the conditions
described:</p>
<li>

<dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
string "complete"</dt>
<p>Run the appropriate steps according to the conditions
described:</p>

<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>
<dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
string "complete"</dt>

<dt>Otherwise</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><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>

<dd><p>Let the <code><a href=#document>Document</a></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>
<dt>Otherwise</dt>

<p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>
<dd><p>Let the <code><a href=#document>Document</a></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>

</dl></li>
<p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>

</ol></li>
</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
Expand Down
48 changes: 20 additions & 28 deletions index
Expand Up @@ -61182,42 +61182,34 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
its rendering, 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><a href=#document>Document</a></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>
<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>

<p>Run the appropriate steps according to the conditions
described:</p>
<li>

<dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
string "complete"</dt>
<p>Run the appropriate steps according to the conditions
described:</p>

<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>
<dl class=switch><dt>If the <a href=#current-document-readiness>current document readiness</a> is set to the
string "complete"</dt>

<dt>Otherwise</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><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>

<dd><p>Let the <code><a href=#document>Document</a></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>
<dt>Otherwise</dt>

<p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>
<dd><p>Let the <code><a href=#document>Document</a></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>

</dl></li>
<p class=note>The event will then be fired just after the <code title=event-load>load</code> event.</dd>

</ol></li>
</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
Expand Down
62 changes: 25 additions & 37 deletions source
Expand Up @@ -69172,52 +69172,40 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
its rendering, 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 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>
<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>

<dl class="switch">
<li>

<dt>If the <span>current document readiness</span> is set to the
string "complete"</dt>
<p>Run the appropriate steps according to the conditions
described:</p>

<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>
<dl class="switch">

<dt>Otherwise</dt>
<dt>If the <span>current document readiness</span> is set to the
string "complete"</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>
<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>

<p class="note">The event will then be fired just after the <code
title="event-load">load</code> event.</p></dd>
<dt>Otherwise</dt>

</dl>
<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>

</li>
<p class="note">The event will then be fired just after the <code
title="event-load">load</code> event.</p></dd>

</ol>
</dl>

</li>

Expand Down

0 comments on commit ed5a13f

Please sign in to comment.