Skip to content
Permalink
Browse files
[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 ed5a13fe5b190d5cd001b14ab19b2623c4b1c85b
Showing with 65 additions and 93 deletions.
  1. +20 −28 complete.html
  2. +20 −28 index
  3. +25 −37 source
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
48 index
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
62 source
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>

0 comments on commit ed5a13f

Please sign in to comment.