Skip to content

Commit

Permalink
[giow] (3) Try to clear up some ambiguities and errors in the navigat…
Browse files Browse the repository at this point in the history
…ion algorithm, and prevent beforeunload from ever navigating its browsing context.

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

git-svn-id: http://svn.whatwg.org/webapps@7554 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 1, 2012
1 parent 2191bc5 commit 2a6bed9
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 44 deletions.
48 changes: 33 additions & 15 deletions complete.html
Expand Up @@ -248,7 +248,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 30 November 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 1 December 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -69016,6 +69016,13 @@ <h4 id=navigating-across-documents><span class=secno>6.6.1 </span>Navigating acr
these steps without affecting the <a href=#unload-a-document>unload a document</a> algorithm or the aforementioned
history traversal task.</li> <!-- this stops pages from hijacking the back/forward button -->

<li><p>If the <a href=#prompt-to-unload-a-document>prompt to unload a document</a> algorithm is being run for the
<a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated, then abort
these steps without affecting the <a href=#prompt-to-unload-a-document>prompt to unload a document</a> algorithm.</li>
<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1946 to 1955 -->

<li><p>Let <var title="">gone async</var> be false.</li>

<li id=navigate-fragid-step><p><i>Fragment identifiers</i>: If the <a href=#absolute-url>absolute URL</a> of
the new resource is the same as the <a href="#the-document's-address" title="the document's address">address</a> of the
<a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated, ignoring any
Expand All @@ -69024,24 +69031,34 @@ <h4 id=navigating-across-documents><span class=secno>6.6.1 </span>Navigating acr
is empty), then <a href=#scroll-to-fragid title=navigate-fragid>navigate to that fragment identifier</a> and
abort these steps.</li>

<li><p>Cancel any preexisting attempt to navigate the <a href=#browsing-context>browsing context</a>, including
canceling any instances of the <a href=#fetch>fetch</a> algorithm started by those attempts. If one of
those attempts has already <a href=#create-a-document-object title="create a document object">created a new
<code>Document</code> object</a>, <a href=#abort-a-document title="abort a document">abort</a> that
<code><a href=#document>Document</a></code> also. (Previous navigation attempts whose <a href=#fetch>fetch</a> requests have
<em>finished</em> are unaffected, however.)</li>
<li><p>If <var title="">gone async</var> is false, cancel any preexisting but not yet <a href=#concept-navigate-mature title=concept-navigate-mature>mature</a> attempt to navigate the <a href=#browsing-context>browsing
context</a>, including canceling any instances of the <a href=#fetch>fetch</a> algorithm started by
those attempts. If one of those attempts has already <a href=#create-a-document-object title="create a document
object">created a new <code>Document</code> object</a>, <a href=#abort-a-document title="abort a
document">abort</a> that <code><a href=#document>Document</a></code> also. (Navigation attempts that have <a href=#concept-navigate-mature title=concept-navigate-mature>matured</a> already have session history entries, and are
therefore handled during the <a href=#update-the-session-history-with-the-new-page>update the session history with the new page</a> algorithm,
later.)</li>

<li><p>If the new resource is to be handled using a mechanism that does not affect the browsing
context, e.g. ignoring the navigation request altogether because the specified scheme is not one
of the supported protocols, then abort these steps and proceed with that mechanism
instead.</li>

<li><p><a href=#prompt-to-unload-a-document title="prompt to unload a document">Prompt to unload</a> the
<code><a href=#document>Document</a></code> object. If the user <a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the document to be
unloaded</a>, then abort these steps.</li>
<li>

<li><p><a href=#abort-a-document title="abort a document">Abort</a> the <a href=#active-document>active document</a> of the
<a href=#browsing-context>browsing context</a>.</li>
<p>If <var title="">gone async</var> is false, <a href=#prompt-to-unload-a-document title="prompt to unload a document">prompt
to unload</a> the <code><a href=#document>Document</a></code> object. If the user <a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the
document to be unloaded</a>, then abort these steps.</p>

<p>If this instance of the <a href=#navigate title=navigate>navigation</a> algorithm gets canceled
while this step is running, the <a href=#prompt-to-unload-a-document>prompt to unload a document</a> algorithm must
nonetheless be run to completion.</p>

</li>

<li><p>If <var title="">gone async</var> is false, <a href=#abort-a-document title="abort a
document">abort</a> the <a href=#active-document>active document</a> of the <a href=#browsing-context>browsing
context</a>.</li>

<li>

Expand Down Expand Up @@ -69108,12 +69125,13 @@ <h4 id=navigating-across-documents><span class=secno>6.6.1 </span>Navigating acr

<!-- *********************************** ASYNC BOUNDARY *********************************** -->

<p>At this point, unless this step has already been reached once before in the execution of this
instance of the algorithm, the user agents must return to whatever algorithm invoked the
navigation steps and must continue these steps asynchronously.</p>
<p>If <var title="">gone async</var> is false, the user agents must return to whatever
algorithm invoked the navigation steps and must continue running these steps asynchronously.</p>

</li>

<li><p>Let <var title="">gone async</var> be true.</li>

<li>

<p>If fetching the resource results in a redirect, and either the <a href=#url>URL</a> of the target
Expand Down
48 changes: 33 additions & 15 deletions index
Expand Up @@ -248,7 +248,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 30 November 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 1 December 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -69016,6 +69016,13 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
these steps without affecting the <a href=#unload-a-document>unload a document</a> algorithm or the aforementioned
history traversal task.</li> <!-- this stops pages from hijacking the back/forward button -->

<li><p>If the <a href=#prompt-to-unload-a-document>prompt to unload a document</a> algorithm is being run for the
<a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated, then abort
these steps without affecting the <a href=#prompt-to-unload-a-document>prompt to unload a document</a> algorithm.</li>
<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1946 to 1955 -->

<li><p>Let <var title="">gone async</var> be false.</li>

<li id=navigate-fragid-step><p><i>Fragment identifiers</i>: If the <a href=#absolute-url>absolute URL</a> of
the new resource is the same as the <a href="#the-document's-address" title="the document's address">address</a> of the
<a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated, ignoring any
Expand All @@ -69024,24 +69031,34 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
is empty), then <a href=#scroll-to-fragid title=navigate-fragid>navigate to that fragment identifier</a> and
abort these steps.</li>

<li><p>Cancel any preexisting attempt to navigate the <a href=#browsing-context>browsing context</a>, including
canceling any instances of the <a href=#fetch>fetch</a> algorithm started by those attempts. If one of
those attempts has already <a href=#create-a-document-object title="create a document object">created a new
<code>Document</code> object</a>, <a href=#abort-a-document title="abort a document">abort</a> that
<code><a href=#document>Document</a></code> also. (Previous navigation attempts whose <a href=#fetch>fetch</a> requests have
<em>finished</em> are unaffected, however.)</li>
<li><p>If <var title="">gone async</var> is false, cancel any preexisting but not yet <a href=#concept-navigate-mature title=concept-navigate-mature>mature</a> attempt to navigate the <a href=#browsing-context>browsing
context</a>, including canceling any instances of the <a href=#fetch>fetch</a> algorithm started by
those attempts. If one of those attempts has already <a href=#create-a-document-object title="create a document
object">created a new <code>Document</code> object</a>, <a href=#abort-a-document title="abort a
document">abort</a> that <code><a href=#document>Document</a></code> also. (Navigation attempts that have <a href=#concept-navigate-mature title=concept-navigate-mature>matured</a> already have session history entries, and are
therefore handled during the <a href=#update-the-session-history-with-the-new-page>update the session history with the new page</a> algorithm,
later.)</li>

<li><p>If the new resource is to be handled using a mechanism that does not affect the browsing
context, e.g. ignoring the navigation request altogether because the specified scheme is not one
of the supported protocols, then abort these steps and proceed with that mechanism
instead.</li>

<li><p><a href=#prompt-to-unload-a-document title="prompt to unload a document">Prompt to unload</a> the
<code><a href=#document>Document</a></code> object. If the user <a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the document to be
unloaded</a>, then abort these steps.</li>
<li>

<li><p><a href=#abort-a-document title="abort a document">Abort</a> the <a href=#active-document>active document</a> of the
<a href=#browsing-context>browsing context</a>.</li>
<p>If <var title="">gone async</var> is false, <a href=#prompt-to-unload-a-document title="prompt to unload a document">prompt
to unload</a> the <code><a href=#document>Document</a></code> object. If the user <a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the
document to be unloaded</a>, then abort these steps.</p>

<p>If this instance of the <a href=#navigate title=navigate>navigation</a> algorithm gets canceled
while this step is running, the <a href=#prompt-to-unload-a-document>prompt to unload a document</a> algorithm must
nonetheless be run to completion.</p>

</li>

<li><p>If <var title="">gone async</var> is false, <a href=#abort-a-document title="abort a
document">abort</a> the <a href=#active-document>active document</a> of the <a href=#browsing-context>browsing
context</a>.</li>

<li>

Expand Down Expand Up @@ -69108,12 +69125,13 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU

<!-- *********************************** ASYNC BOUNDARY *********************************** -->

<p>At this point, unless this step has already been reached once before in the execution of this
instance of the algorithm, the user agents must return to whatever algorithm invoked the
navigation steps and must continue these steps asynchronously.</p>
<p>If <var title="">gone async</var> is false, the user agents must return to whatever
algorithm invoked the navigation steps and must continue running these steps asynchronously.</p>

</li>

<li><p>Let <var title="">gone async</var> be true.</li>

<li>

<p>If fetching the resource results in a redirect, and either the <a href=#url>URL</a> of the target
Expand Down
48 changes: 34 additions & 14 deletions source
Expand Up @@ -80773,6 +80773,13 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
these steps without affecting the <span>unload a document</span> algorithm or the aforementioned
history traversal task.</p></li> <!-- this stops pages from hijacking the back/forward button -->

<li><p>If the <span>prompt to unload a document</span> algorithm is being run for the
<span>active document</span> of the <span>browsing context</span> being navigated, then abort
these steps without affecting the <span>prompt to unload a document</span> algorithm.</p></li>
<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1946 to 1955 -->

<li><p>Let <var title="">gone async</var> be false.</p></li>

<li id="navigate-fragid-step"><p><i>Fragment identifiers</i>: If the <span>absolute URL</span> of
the new resource is the same as the <span title="the document's address">address</span> of the
<span>active document</span> of the <span>browsing context</span> being navigated, ignoring any
Expand All @@ -80783,24 +80790,36 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
is empty), then <span title="navigate-fragid">navigate to that fragment identifier</span> and
abort these steps.</p></li>

<li><p>Cancel any preexisting attempt to navigate the <span>browsing context</span>, including
canceling any instances of the <span>fetch</span> algorithm started by those attempts. If one of
those attempts has already <span title="create a document object">created a new
<code>Document</code> object</span>, <span title="abort a document">abort</span> that
<code>Document</code> also. (Previous navigation attempts whose <span>fetch</span> requests have
<em>finished</em> are unaffected, however.)</p></li>
<li><p>If <var title="">gone async</var> is false, cancel any preexisting but not yet <span
title="concept-navigate-mature">mature</span> attempt to navigate the <span>browsing
context</span>, including canceling any instances of the <span>fetch</span> algorithm started by
those attempts. If one of those attempts has already <span title="create a document
object">created a new <code>Document</code> object</span>, <span title="abort a
document">abort</span> that <code>Document</code> also. (Navigation attempts that have <span
title="concept-navigate-mature">matured</span> already have session history entries, and are
therefore handled during the <span>update the session history with the new page</span> algorithm,
later.)</p></li>

<li><p>If the new resource is to be handled using a mechanism that does not affect the browsing
context, e.g. ignoring the navigation request altogether because the specified scheme is not one
of the supported protocols, then abort these steps and proceed with that mechanism
instead.</p></li>

<li><p><span title="prompt to unload a document">Prompt to unload</span> the
<code>Document</code> object. If the user <span>refused to allow the document to be
unloaded</span>, then abort these steps.</p></li>
<li>

<li><p><span title="abort a document">Abort</span> the <span>active document</span> of the
<span>browsing context</span>.</p></li>
<p>If <var title="">gone async</var> is false, <span title="prompt to unload a document">prompt
to unload</span> the <code>Document</code> object. If the user <span>refused to allow the
document to be unloaded</span>, then abort these steps.</p>

<p>If this instance of the <span title="navigate">navigation</span> algorithm gets canceled
while this step is running, the <span>prompt to unload a document</span> algorithm must
nonetheless be run to completion.</p>

</li>

<li><p>If <var title="">gone async</var> is false, <span title="abort a
document">abort</span> the <span>active document</span> of the <span>browsing
context</span>.</p></li>

<li>

Expand Down Expand Up @@ -80872,12 +80891,13 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O

<!-- *********************************** ASYNC BOUNDARY *********************************** -->

<p>At this point, unless this step has already been reached once before in the execution of this
instance of the algorithm, the user agents must return to whatever algorithm invoked the
navigation steps and must continue these steps asynchronously.</p>
<p>If <var title="">gone async</var> is false, the user agents must return to whatever
algorithm invoked the navigation steps and must continue running these steps asynchronously.</p>

</li>

<li><p>Let <var title="">gone async</var> be true.</p></li>

<li>

<p>If fetching the resource results in a redirect, and either the <span>URL</span> of the target
Expand Down

0 comments on commit 2a6bed9

Please sign in to comment.