Skip to content

Commit

Permalink
[giow] (3) Try to match reality better for dynamic location.hash navi…
Browse files Browse the repository at this point in the history
…gation.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17155
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@7846 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 22, 2013
1 parent db487b9 commit d0d9b65
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 49 deletions.
39 changes: 24 additions & 15 deletions complete.html
Expand Up @@ -67557,7 +67557,7 @@ <h4 id=read-ua-inline><span class=secno>6.6.8 </span><dfn title=navigate-ua-inli
<h4 id=scroll-to-fragid><span class=secno>6.6.9 </span><dfn title=navigate-fragid>Navigating to a fragment identifier</dfn></h4>

<p>When a user agent is supposed to navigate to a fragment identifier, then the user agent must
<a href=#queue-a-task>queue a task</a> to run the following steps:</p>
run the following steps:</p>

<ol><li>

Expand All @@ -67579,7 +67579,8 @@ <h4 id=scroll-to-fragid><span class=secno>6.6.9 </span><dfn title=navigate-fragi
to the address to which the user agent was <a href=#navigate title=navigate>navigating</a>. The title
must be left unset.</li>

<li><p><a href=#traverse-the-history>Traverse the history</a> to the new entry. This will <a href=#scroll-to-the-fragment-identifier>scroll to the fragment
<li><p><a href=#traverse-the-history>Traverse the history</a> to the new entry, with the <i>asynchronous events</i> flag
set. This will <a href=#scroll-to-the-fragment-identifier>scroll to the fragment
identifier</a> given in what is now <a href="#the-document's-address">the document's address</a>.</li>

</ol><p class=note>If the scrolling fails because the relevant <a href=#concept-id title=concept-id>ID</a> has
Expand Down Expand Up @@ -67650,8 +67651,8 @@ <h4 id=history-traversal><span class=secno>6.6.10 </span>History traversal</h4>
<div class=impl>

<p>When a user agent is required to <dfn id=traverse-the-history>traverse the history</dfn> to a <var title="">specified
entry</var>, optionally with <a href=#replacement-enabled>replacement enabled</a>, the user agent must act as
follows.</p>
entry</var>, optionally with <a href=#replacement-enabled>replacement enabled</a>, and optionally with the
<i>asynchronous events</i> flag set, the user agent must act as follows.</p>

<p class=note>This algorithm is not just invoked when <a href=#traverse-the-history-by-a-delta title="traverse the history by a
delta">explicitly going back or forwards in the session history</a> &mdash; it is also invoked
Expand Down Expand Up @@ -67789,17 +67790,25 @@ <h4 id=history-traversal><span class=secno>6.6.10 </span>History traversal</h4>

<li><p>Let the <a href=#latest-entry>latest entry</a> of the <code><a href=#document>Document</a></code> of the <var title="">specified entry</var> be the <var title="">specified entry</var>.</li>

<li><p>If <var title="">state changed</var> is true, <a href=#concept-event-fire title=concept-event-fire>fire</a>
a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-popstate><a href=#event-popstate>popstate</a></code> 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 initialized to the value of <var title="">state</var>. This event must bubble but not be cancelable and has no default
action.</li>

<li><p>If <var title="">hash changed</var> is true, then <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> 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 initialized to <var title="">old URL</var> and the <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code> attribute
initialized to <var title="">new URL</var>. This event must bubble but not be cancelable and has
no default action.</li>
<li>

<p>If the <i>asynchronous events</i> flag is not set, then run the following steps
synchronously. Otherwise, the <i>asynchronous events</i> flag is set; <a href=#queue-a-task>queue a task</a>
to run the following substeps.</p>

<ol><li><p>If <var title="">state changed</var> is true, <a href=#concept-event-fire title=concept-event-fire>fire</a>
a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-popstate><a href=#event-popstate>popstate</a></code> 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 initialized to the value of <var title="">state</var>. This event must bubble but not be cancelable and has no default
action.</li>

<li><p>If <var title="">hash changed</var> is true, then <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> 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 initialized to <var title="">old URL</var> and the <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code> attribute
initialized to <var title="">new URL</var>. This event must bubble but not be cancelable and has
no default action.</li>

</ol></li>

<li><p>The <a href=#current-entry>current entry</a> is now the <var title="">specified entry</var>.</li>

Expand Down
39 changes: 24 additions & 15 deletions index
Expand Up @@ -67557,7 +67557,7 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
<h4 id=scroll-to-fragid><span class=secno>6.6.9 </span><dfn title=navigate-fragid>Navigating to a fragment identifier</dfn></h4>

<p>When a user agent is supposed to navigate to a fragment identifier, then the user agent must
<a href=#queue-a-task>queue a task</a> to run the following steps:</p>
run the following steps:</p>

<ol><li>

Expand All @@ -67579,7 +67579,8 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
to the address to which the user agent was <a href=#navigate title=navigate>navigating</a>. The title
must be left unset.</li>

<li><p><a href=#traverse-the-history>Traverse the history</a> to the new entry. This will <a href=#scroll-to-the-fragment-identifier>scroll to the fragment
<li><p><a href=#traverse-the-history>Traverse the history</a> to the new entry, with the <i>asynchronous events</i> flag
set. This will <a href=#scroll-to-the-fragment-identifier>scroll to the fragment
identifier</a> given in what is now <a href="#the-document's-address">the document's address</a>.</li>

</ol><p class=note>If the scrolling fails because the relevant <a href=#concept-id title=concept-id>ID</a> has
Expand Down Expand Up @@ -67650,8 +67651,8 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
<div class=impl>

<p>When a user agent is required to <dfn id=traverse-the-history>traverse the history</dfn> to a <var title="">specified
entry</var>, optionally with <a href=#replacement-enabled>replacement enabled</a>, the user agent must act as
follows.</p>
entry</var>, optionally with <a href=#replacement-enabled>replacement enabled</a>, and optionally with the
<i>asynchronous events</i> flag set, the user agent must act as follows.</p>

<p class=note>This algorithm is not just invoked when <a href=#traverse-the-history-by-a-delta title="traverse the history by a
delta">explicitly going back or forwards in the session history</a> &mdash; it is also invoked
Expand Down Expand Up @@ -67789,17 +67790,25 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU

<li><p>Let the <a href=#latest-entry>latest entry</a> of the <code><a href=#document>Document</a></code> of the <var title="">specified entry</var> be the <var title="">specified entry</var>.</li>

<li><p>If <var title="">state changed</var> is true, <a href=#concept-event-fire title=concept-event-fire>fire</a>
a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-popstate><a href=#event-popstate>popstate</a></code> 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 initialized to the value of <var title="">state</var>. This event must bubble but not be cancelable and has no default
action.</li>

<li><p>If <var title="">hash changed</var> is true, then <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> 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 initialized to <var title="">old URL</var> and the <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code> attribute
initialized to <var title="">new URL</var>. This event must bubble but not be cancelable and has
no default action.</li>
<li>

<p>If the <i>asynchronous events</i> flag is not set, then run the following steps
synchronously. Otherwise, the <i>asynchronous events</i> flag is set; <a href=#queue-a-task>queue a task</a>
to run the following substeps.</p>

<ol><li><p>If <var title="">state changed</var> is true, <a href=#concept-event-fire title=concept-event-fire>fire</a>
a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event with the name <code title=event-popstate><a href=#event-popstate>popstate</a></code> 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 initialized to the value of <var title="">state</var>. This event must bubble but not be cancelable and has no default
action.</li>

<li><p>If <var title="">hash changed</var> is true, then <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a>
event with the name <code title=event-hashchange><a href=#event-hashchange>hashchange</a></code> 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 initialized to <var title="">old URL</var> and the <code title=dom-HashChangeEvent-newURL><a href=#dom-hashchangeevent-newurl>newURL</a></code> attribute
initialized to <var title="">new URL</var>. This event must bubble but not be cancelable and has
no default action.</li>

</ol></li>

<li><p>The <a href=#current-entry>current entry</a> is now the <var title="">specified entry</var>.</li>

Expand Down
51 changes: 32 additions & 19 deletions source
Expand Up @@ -75566,7 +75566,7 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<h4 id="scroll-to-fragid"><dfn title="navigate-fragid">Navigating to a fragment identifier</dfn></h4>

<p>When a user agent is supposed to navigate to a fragment identifier, then the user agent must
<span>queue a task</span> to run the following steps:</p>
run the following steps:</p>

<ol>

Expand All @@ -75590,7 +75590,8 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
to the address to which the user agent was <span title="navigate">navigating</span>. The title
must be left unset.</p></li>

<li><p><span>Traverse the history</span> to the new entry. This will <span>scroll to the fragment
<li><p><span>Traverse the history</span> to the new entry, with the <i>asynchronous events</i> flag
set. This will <span>scroll to the fragment
identifier</span> given in what is now <span>the document's address</span>.</p></li>

</ol>
Expand Down Expand Up @@ -75675,8 +75676,8 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<div class="impl">

<p>When a user agent is required to <dfn>traverse the history</dfn> to a <var title="">specified
entry</var>, optionally with <span>replacement enabled</span>, the user agent must act as
follows.</p>
entry</var>, optionally with <span>replacement enabled</span>, and optionally with the
<i>asynchronous events</i> flag set, the user agent must act as follows.</p>

<p class="note">This algorithm is not just invoked when <span title="traverse the history by a
delta">explicitly going back or forwards in the session history</span> &mdash; it is also invoked
Expand Down Expand Up @@ -75849,22 +75850,34 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<li><p>Let the <span>latest entry</span> of the <code>Document</code> of the <var
title="">specified entry</var> be the <var title="">specified entry</var>.</p></li>

<li><p>If <var title="">state changed</var> is true, <span title="concept-event-fire">fire</span>
a <span title="concept-events-trusted">trusted</span> event with the name <code
title="event-popstate">popstate</code> 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 initialized to the value of <var
title="">state</var>. This event must bubble but not be cancelable and has no default
action.</p></li>
<li>

<li><p>If <var title="">hash changed</var> is true, then <span
title="concept-event-fire">fire</span> a <span title="concept-events-trusted">trusted</span>
event with the name <code title="event-hashchange">hashchange</code> 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 initialized to <var
title="">old URL</var> and the <code title="dom-HashChangeEvent-newURL">newURL</code> attribute
initialized to <var title="">new URL</var>. This event must bubble but not be cancelable and has
no default action.</p></li>
<p>If the <i>asynchronous events</i> flag is not set, then run the following steps
synchronously. Otherwise, the <i>asynchronous events</i> flag is set; <span>queue a task</span>
to run the following substeps.</p>

<ol>

<li><p>If <var title="">state changed</var> is true, <span title="concept-event-fire">fire</span>
a <span title="concept-events-trusted">trusted</span> event with the name <code
title="event-popstate">popstate</code> 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 initialized to the value of <var
title="">state</var>. This event must bubble but not be cancelable and has no default
action.</p></li>

<li><p>If <var title="">hash changed</var> is true, then <span
title="concept-event-fire">fire</span> a <span title="concept-events-trusted">trusted</span>
event with the name <code title="event-hashchange">hashchange</code> 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 initialized to <var
title="">old URL</var> and the <code title="dom-HashChangeEvent-newURL">newURL</code> attribute
initialized to <var title="">new URL</var>. This event must bubble but not be cancelable and has
no default action.</p></li>

</ol>

</li>

<li><p>The <span>current entry</span> is now the <var title="">specified entry</var>.</p></li>

Expand Down

0 comments on commit d0d9b65

Please sign in to comment.