Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (2) Define how location.href='foo' aborts parsing.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10625

git-svn-id: http://svn.whatwg.org/webapps@5643 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 22, 2010
1 parent 78a2a0e commit 81478fe
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 45 deletions.
59 changes: 44 additions & 15 deletions complete.html
Expand Up @@ -214,7 +214,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 19 October 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 22 October 2010</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>-->
Expand Down Expand Up @@ -8424,7 +8424,8 @@ <h4 id=resource-metadata-management><span class=secno>3.1.3 </span><dfn>Resource
<p>A <code><a href=#document>Document</a></code> is said to have an <dfn id=active-parser>active
parser</dfn> if it is associated with an <a href=#html-parser>HTML parser</a> or
an <a href=#xml-parser>XML parser</a> that has not yet been <a href=#stop-parsing title="stop
parsing">stopped</a> or aborted.</p>
parsing">stopped</a> or <a href=#abort-a-parser title="abort a
parser">aborted</a>.</p>

<p>The <dfn id=dom-document-readystate title=dom-document-readyState><code>readyState</code></dfn> IDL
attribute must, on getting, return the <a href=#current-document-readiness>current document
Expand Down Expand Up @@ -11485,9 +11486,8 @@ <h4 id=opening-the-input-stream><span class=secno>3.5.1 </span>Opening the input
<code><a href=#document>Document</a></code> object, with the <var title="">recycle</var>
parameter set to true.</li>

<li><p>If the document has an <a href=#active-parser>active parser</a>, then
<a href=#abort-an-html-parser title="abort an HTML parser">abort that
parser</a>.</li>
<li><p><a href=#abort-a-document title="abort a document">Abort</a> the
<code><a href=#document>Document</a></code>.</li>

<li><p>Unregister all event listeners registered on the
<code><a href=#document>Document</a></code> node and its descendants.</p>
Expand Down Expand Up @@ -61346,6 +61346,10 @@ <h4 id=navigating-across-documents><span class=secno>6.5.1 </span>Navigating acr
<li><p>Cancel <em>any</em> preexisting attempt to navigate the
<a href=#browsing-context>browsing context</a>.</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>

<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
Expand Down Expand Up @@ -62549,12 +62553,32 @@ <h4 id=unloading-documents><span class=secno>6.5.10 </span>Unloading documents</

<h4 id=aborting-a-document-load><span class=secno>6.5.11 </span>Aborting a document load</h4>

<p>If the user cancels any instance of the <a href=#fetch title=fetch>fetching algorithm</a> in the context of a
<code><a href=#document>Document</a></code> in a <a href=#browsing-context>browsing context</a>, then, if
that <code><a href=#document>Document</a></code> is an <a href=#active-document>active document</a>, the
user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
<p>If a <code><a href=#document>Document</a></code> is <dfn id=abort-a-document title="abort a
document">aborted</dfn>, the user agent must run the following
steps:</p>

<ol><li><p><a href=#abort-a-document title="abort a document">Abort</a> the <a href=#active-document title="active document">active documents</a> of every
<a href=#child-browsing-context>child browsing context</a>.</li>

<li><p>Cancel any instances of the <a href=#fetch title=fetch>fetch</a>
algorithm in the context of this <code><a href=#document>Document</a></code>, discarding
any <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue a
task">queued</a> for them, and discarding any further data
received from the network for them.</li>

<li><p>If the <code><a href=#document>Document</a></code> has an <a href=#active-parser>active
parser</a>, then <a href=#abort-a-parser title="abort a parser">abort that
parser</a>.</li>

<!-- we could also stop all script, or stop animations -->

</ol><p>User agents may allow users to explicitly invoke the <a href=#abort-a-document title="abort a document">abort a document</a> algorithm for a
<code><a href=#document>Document</a></code>. If the user does so, then, if that
<code><a href=#document>Document</a></code> is an <a href=#active-document>active document</a>, the user
agent should <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-abort>abort</code> at that
<code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object.</p>
<code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object before invoking
the <a href=#abort-a-document title="abort a document">abort</a> algorithm.</p>

<!-- I'd love to make this more precise, anyone have any suggestions
on what it should say? -->
Expand Down Expand Up @@ -83415,8 +83439,8 @@ <h4 id=the-end><span class=secno>12.2.6 </span>The end</h4>
<li><p>The <code><a href=#document>Document</a></code> is now <dfn id=completely-loaded>completely
loaded</dfn>.</li>

</ol><p>When the user agent is to <dfn id=abort-an-html-parser>abort an HTML parser</dfn>, it
must run the following steps:</p>
</ol><p>When the user agent is to <dfn id=abort-a-parser>abort a parser</dfn>, it must run
the following steps:</p>

<ol><li><p>Throw away any pending content in the <a href=#the-input-stream>input
stream</a>, and discard any future content that would have been
Expand All @@ -83426,8 +83450,11 @@ <h4 id=the-end><span class=secno>12.2.6 </span>The end</h4>
elements</a>.</li>

<!-- anything else? this is things that happen when you call
document.open() on a document that's still being parsed. Should the
pending scripts be blown away or anything? -->
document.open() on a document that's still being parsed, or when
you navigate a document that's still parsing, or navigate the
parent of a frame with a document that's still parsing, or the user
hits "stop". Should the pending scripts be blown away or anything?
-->

</ol><p>Except where otherwise specified, the <a href=#task-source>task source</a>
for the <a href=#concept-task title=concept-task>tasks</a> mentioned in this
Expand Down Expand Up @@ -84322,7 +84349,9 @@ <h3 id=parsing-xhtml-documents><span class=secno>13.2 </span>Parsing XHTML docum

<p>When an <a href=#xml-parser>XML parser</a> reaches the end of its input, it
must <a href=#stop-parsing>stop parsing</a>, following the same rules as the
<a href=#html-parser>HTML parser</a>.</p>
<a href=#html-parser>HTML parser</a>. An <a href=#xml-parser>XML parser</a> can also be
<a href=#abort-a-parser title="abort a parser">aborted</a>, which must again by
done in the same way as for an <a href=#html-parser>HTML parser</a>.</p>

<p>For the purposes of conformance checkers, if a resource is
determined to be in <a href=#the-xhtml-syntax>the XHTML syntax</a>, then it is an
Expand Down
59 changes: 44 additions & 15 deletions index
Expand Up @@ -218,7 +218,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>HTML5 (including next generation additions still in development)</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 19 October 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 22 October 2010</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>-->
Expand Down Expand Up @@ -8401,7 +8401,8 @@ interface <dfn id=htmldocument>HTMLDocument</dfn> {
<p>A <code><a href=#document>Document</a></code> is said to have an <dfn id=active-parser>active
parser</dfn> if it is associated with an <a href=#html-parser>HTML parser</a> or
an <a href=#xml-parser>XML parser</a> that has not yet been <a href=#stop-parsing title="stop
parsing">stopped</a> or aborted.</p>
parsing">stopped</a> or <a href=#abort-a-parser title="abort a
parser">aborted</a>.</p>

<p>The <dfn id=dom-document-readystate title=dom-document-readyState><code>readyState</code></dfn> IDL
attribute must, on getting, return the <a href=#current-document-readiness>current document
Expand Down Expand Up @@ -11462,9 +11463,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
<code><a href=#document>Document</a></code> object, with the <var title="">recycle</var>
parameter set to true.</li>

<li><p>If the document has an <a href=#active-parser>active parser</a>, then
<a href=#abort-an-html-parser title="abort an HTML parser">abort that
parser</a>.</li>
<li><p><a href=#abort-a-document title="abort a document">Abort</a> the
<code><a href=#document>Document</a></code>.</li>

<li><p>Unregister all event listeners registered on the
<code><a href=#document>Document</a></code> node and its descendants.</p>
Expand Down Expand Up @@ -61326,6 +61326,10 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU
<li><p>Cancel <em>any</em> preexisting attempt to navigate the
<a href=#browsing-context>browsing context</a>.</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>

<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
Expand Down Expand Up @@ -62532,12 +62536,32 @@ State: &lt;OUTPUT NAME=I&gt;1&lt;/OUTPUT&gt; &lt;INPUT VALUE="Increment" TYPE=BU

<h4 id=aborting-a-document-load><span class=secno>6.5.11 </span>Aborting a document load</h4>

<p>If the user cancels any instance of the <a href=#fetch title=fetch>fetching algorithm</a> in the context of a
<code><a href=#document>Document</a></code> in a <a href=#browsing-context>browsing context</a>, then, if
that <code><a href=#document>Document</a></code> is an <a href=#active-document>active document</a>, the
user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
<p>If a <code><a href=#document>Document</a></code> is <dfn id=abort-a-document title="abort a
document">aborted</dfn>, the user agent must run the following
steps:</p>

<ol><li><p><a href=#abort-a-document title="abort a document">Abort</a> the <a href=#active-document title="active document">active documents</a> of every
<a href=#child-browsing-context>child browsing context</a>.</li>

<li><p>Cancel any instances of the <a href=#fetch title=fetch>fetch</a>
algorithm in the context of this <code><a href=#document>Document</a></code>, discarding
any <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue a
task">queued</a> for them, and discarding any further data
received from the network for them.</li>

<li><p>If the <code><a href=#document>Document</a></code> has an <a href=#active-parser>active
parser</a>, then <a href=#abort-a-parser title="abort a parser">abort that
parser</a>.</li>

<!-- we could also stop all script, or stop animations -->

</ol><p>User agents may allow users to explicitly invoke the <a href=#abort-a-document title="abort a document">abort a document</a> algorithm for a
<code><a href=#document>Document</a></code>. If the user does so, then, if that
<code><a href=#document>Document</a></code> is an <a href=#active-document>active document</a>, the user
agent should <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-abort>abort</code> at that
<code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object.</p>
<code><a href=#document>Document</a></code>'s <code><a href=#window>Window</a></code> object before invoking
the <a href=#abort-a-document title="abort a document">abort</a> algorithm.</p>

<!-- I'd love to make this more precise, anyone have any suggestions
on what it should say? -->
Expand Down Expand Up @@ -79329,8 +79353,8 @@ document.body.appendChild(text);
<li><p>The <code><a href=#document>Document</a></code> is now <dfn id=completely-loaded>completely
loaded</dfn>.</li>

</ol><p>When the user agent is to <dfn id=abort-an-html-parser>abort an HTML parser</dfn>, it
must run the following steps:</p>
</ol><p>When the user agent is to <dfn id=abort-a-parser>abort a parser</dfn>, it must run
the following steps:</p>

<ol><li><p>Throw away any pending content in the <a href=#the-input-stream>input
stream</a>, and discard any future content that would have been
Expand All @@ -79340,8 +79364,11 @@ document.body.appendChild(text);
elements</a>.</li>

<!-- anything else? this is things that happen when you call
document.open() on a document that's still being parsed. Should the
pending scripts be blown away or anything? -->
document.open() on a document that's still being parsed, or when
you navigate a document that's still parsing, or navigate the
parent of a frame with a document that's still parsing, or the user
hits "stop". Should the pending scripts be blown away or anything?
-->

</ol><p>Except where otherwise specified, the <a href=#task-source>task source</a>
for the <a href=#concept-task title=concept-task>tasks</a> mentioned in this
Expand Down Expand Up @@ -80236,7 +80263,9 @@ document.body.appendChild(text);

<p>When an <a href=#xml-parser>XML parser</a> reaches the end of its input, it
must <a href=#stop-parsing>stop parsing</a>, following the same rules as the
<a href=#html-parser>HTML parser</a>.</p>
<a href=#html-parser>HTML parser</a>. An <a href=#xml-parser>XML parser</a> can also be
<a href=#abort-a-parser title="abort a parser">aborted</a>, which must again by
done in the same way as for an <a href=#html-parser>HTML parser</a>.</p>

<p>For the purposes of conformance checkers, if a resource is
determined to be in <a href=#the-xhtml-syntax>the XHTML syntax</a>, then it is an
Expand Down
64 changes: 49 additions & 15 deletions source
Expand Up @@ -8374,7 +8374,8 @@ interface <dfn>HTMLDocument</dfn> {
<p>A <code>Document</code> is said to have an <dfn>active
parser</dfn> if it is associated with an <span>HTML parser</span> or
an <span>XML parser</span> that has not yet been <span title="stop
parsing">stopped</span> or aborted.</p>
parsing">stopped</span> or <span title="abort a
parser">aborted</span>.</p>

<p>The <dfn
title="dom-document-readyState"><code>readyState</code></dfn> IDL
Expand Down Expand Up @@ -11892,9 +11893,8 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0
<code>Document</code> object, with the <var title="">recycle</var>
parameter set to true.</p></li>

<li><p>If the document has an <span>active parser</span>, then
<span title="abort an HTML parser">abort that
parser</span>.</p></li>
<li><p><span title="abort a document">Abort</span> the
<code>Document</code>.</p></li>

<li><p>Unregister all event listeners registered on the
<code>Document</code> node and its descendants.</p>
Expand Down Expand Up @@ -69344,6 +69344,10 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O
<li><p>Cancel <em>any</em> preexisting attempt to navigate the
<span>browsing context</span>.</p></li>

<li><p><span title="abort a document">Abort</span> the
<span>active document</span> of the <span>browsing
context</span>.</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
Expand Down Expand Up @@ -70751,13 +70755,38 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O

<h4>Aborting a document load</h4>

<p>If the user cancels any instance of the <span
title="fetch">fetching algorithm</span> in the context of a
<code>Document</code> in a <span>browsing context</span>, then, if
that <code>Document</code> is an <span>active document</span>, the
user agent must <span>queue a task</span> to <span>fire a simple
<p>If a <code>Document</code> is <dfn title="abort a
document">aborted</dfn>, the user agent must run the following
steps:</p>

<ol>

<li><p><span title="abort a document">Abort</span> the <span
title="active document">active documents</span> of every
<span>child browsing context</span>.</p></li>

<li><p>Cancel any instances of the <span title="fetch">fetch</span>
algorithm in the context of this <code>Document</code>, discarding
any <span title="concept-task">tasks</span> <span title="queue a
task">queued</span> for them, and discarding any further data
received from the network for them.</p></li>

<li><p>If the <code>Document</code> has an <span>active
parser</span>, then <span title="abort a parser">abort that
parser</span>.</p></li>

<!-- we could also stop all script, or stop animations -->

</ol>

<p>User agents may allow users to explicitly invoke the <span
title="abort a document">abort a document</span> algorithm for a
<code>Document</code>. If the user does so, then, if that
<code>Document</code> is an <span>active document</span>, the user
agent should <span>queue a task</span> to <span>fire a simple
event</span> named <code title="event-abort">abort</code> at that
<code>Document</code>'s <code>Window</code> object.</p>
<code>Document</code>'s <code>Window</code> object before invoking
the <span title="abort a document">abort</span> algorithm.</p>

<!-- I'd love to make this more precise, anyone have any suggestions
on what it should say? -->
Expand Down Expand Up @@ -95213,8 +95242,8 @@ document.body.appendChild(text);

</ol>

<p>When the user agent is to <dfn>abort an HTML parser</dfn>, it
must run the following steps:</p>
<p>When the user agent is to <dfn>abort a parser</dfn>, it must run
the following steps:</p>

<ol>

Expand All @@ -95226,8 +95255,11 @@ document.body.appendChild(text);
elements</span>.</p></li>

<!-- anything else? this is things that happen when you call
document.open() on a document that's still being parsed. Should the
pending scripts be blown away or anything? -->
document.open() on a document that's still being parsed, or when
you navigate a document that's still parsing, or navigate the
parent of a frame with a document that's still parsing, or the user
hits "stop". Should the pending scripts be blown away or anything?
-->

</ol>

Expand Down Expand Up @@ -96254,7 +96286,9 @@ document.body.appendChild(text);

<p>When an <span>XML parser</span> reaches the end of its input, it
must <span>stop parsing</span>, following the same rules as the
<span>HTML parser</span>.</p>
<span>HTML parser</span>. An <span>XML parser</span> can also be
<span title="abort a parser">aborted</span>, which must again by
done in the same way as for an <span>HTML parser</span>.</p>

<p>For the purposes of conformance checkers, if a resource is
determined to be in <span>the XHTML syntax</span>, then it is an
Expand Down

0 comments on commit 81478fe

Please sign in to comment.