Skip to content
Permalink
Browse files

[giow] (2) Make 'abort the parser' fire some readystatechange events …

…for more consistency. Slightly expand on how little XSLT/HTML interactions are defined. Rename 'cookie-free' to 'cookie-averse' for clarity.

Affected topics: DOM APIs, HTML, HTML Syntax and Parsing

git-svn-id: http://svn.whatwg.org/webapps@7169 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Jul 10, 2012
1 parent b3bf8ad commit dbf9299a2609880de73aa0cf3b34a0327517986b
Showing with 154 additions and 84 deletions.
  1. +48 −28 complete.html
  2. +48 −28 index
  3. +58 −28 source

<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 9 July 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 10 July 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>
<code><a href=#document>Document</a></code> was created.</p>

<p>A <code><a href=#document>Document</a></code> object that falls into one of the
following conditions is a <dfn id=cookie-free-document-object>cookie-free <code>Document</code>
following conditions is a <dfn id=cookie-averse-document-object>cookie-averse <code>Document</code>
object</dfn>:</p>

<ul><li>A <code><a href=#document>Document</a></code> that has no <a href=#browsing-context>browsing
authority.</li>

</ul><!--Other specifications can also define <code>Document</code>
objects as being <span title="cookie-free Document
object">cookie-free <code>Document</code> objects</span>.--><p id=sandboxCookies>On getting, if the document is a
<a href=#cookie-free-document-object>cookie-free <code>Document</code> object</a>, then the user
agent must return the empty string. Otherwise, if the
objects as being <span title="cookie-averse Document
object">cookie-averse <code>Document</code> objects</span>.--><p id=sandboxCookies>On getting, if the document is a
<a href=#cookie-averse-document-object>cookie-averse <code>Document</code> object</a>, then the
user agent must return the empty string. Otherwise, if the
<code><a href=#document>Document</a></code>'s <a href=#origin>origin</a> is not a
scheme/host/port tuple, the user agent must throw a
<code><a href=#securityerror>SecurityError</a></code> exception. Otherwise, the user agent must
"non-HTTP" API, <a href=#decoded-as-utf-8,-with-error-handling>decoded as UTF-8, with error handling</a>.
<a href=#refsCOOKIES>[COOKIES]</a></p>

<p>On setting, if the document is a <a href=#cookie-free-document-object>cookie-free
<p>On setting, if the document is a <a href=#cookie-averse-document-object>cookie-averse
<code>Document</code> object</a>, then the user agent must do
nothing. Otherwise, if the <code><a href=#document>Document</a></code>'s
<a href=#origin>origin</a> is not a scheme/host/port tuple, the user agent

<p>Each document has a <dfn id=current-document-readiness>current document readiness</dfn>. When a
<code><a href=#document>Document</a></code> object is created, it must have its
<a href=#current-document-readiness>current document readiness</a> set to the string "<code title="">loading</code>"
if the document is associated with an <a href=#html-parser>HTML parser</a> or an
<a href=#xml-parser>XML parser</a>, or to the string "<code title="">complete</code>" otherwise.
Various algorithms during page loading affect this value. When the
value is set, the user agent must <a href=#fire-a-simple-event>fire a simple event</a>
named <dfn id=event-readystatechange title=event-readystatechange><code>readystatechange</code></dfn>
<a href=#current-document-readiness>current document readiness</a> set to the string "<code title="">loading</code>" if the document is associated with an
<a href=#html-parser>HTML parser</a>, an <a href=#xml-parser>XML parser</a>, or an XSLT
processor, and to the string "<code title="">complete</code>"
otherwise. Various algorithms during page loading affect this value.
When the value is set, the user agent must <a href=#fire-a-simple-event>fire a simple
event</a> named <dfn id=event-readystatechange title=event-readystatechange><code>readystatechange</code></dfn>
at the <code><a href=#document>Document</a></code> object.</p>

<p>A <code><a href=#document>Document</a></code> is said to have an <dfn id=active-parser>active
unaffected.) <a href=#refsXSLT10>[XSLT10]</a></p> <!-- note:
version matters for this ref -->

<p class=note>There are also additional comments regarding the
interaction of XSLT and HTML <a href=#scriptTagXSLT>in the
<code>script</code> element section</a>.</p>
<hr><p>This specification does not specify precisely how XSLT processing
interacts with the <a href=#html-parser>HTML parser</a> infrastructure (for
example, whether an XSLT processor acts as if it puts any elements
into a <a href=#stack-of-open-elements>stack of open elements</a>). However, XSLT
processors must <a href=#stop-parsing>stop parsing</a> if they successfully
complete, and must set the <a href=#current-document-readiness>current document readiness</a>
first to "<code title="">interactive</code>"<!-- this synchronously
fires an event --> and then to "<code title="">complete</code>"<!--
this also synchronously fires an event --> if they are aborted.</p>

<hr><p>This specification does not specify how XSLT interacts with the
<a href=#navigate title=navigate>navigation</a> algorithm, how it fits in
with the <a href=#event-loop>event loop</a>, nor how error pages are to be
handled (e.g. whether XSLT errors are to replace an incremental XSLT
output, or are rendered inline, etc).</p>

<p class=note>There are also additional non-normative comments
regarding the interaction of XSLT and HTML <a href=#scriptTagXSLT>in the <code>script</code> element
section</a>.</p>

</div>

<p><i>This section is non-normative.</i></p>

<p>This specification does not define how XSLT interacts with the
<code><a href=#the-script-element>script</a></code> element (or, indeed, how XSLT processing
triggers the <a href=#stop-parsing>stop parsing</a> steps, how it interacts with
the <a href=#navigate title=navigate>navigation</a> algorithm, or how it
fits in with the <a href=#event-loop>event loop</a>). However, in the absence
of another specification actually defining this, here are some
guidelines for implementors, based on existing implementations:</p>
<code><a href=#the-script-element>script</a></code> element. However, in the absence of another
specification actually defining this, here are some guidelines for
implementors, based on existing implementations:</p>

<ul><li><p>When an XSLT transformation program is triggered by an <code title="">&lt;?xml-stylesheet?&gt;</code> processing instruction and
the browser implements a direct-to-DOM transformation,
on <code><a href=#window>Window</a></code> objects should, if there is an existing
attempt to <a href=#navigate>navigate</a> the <a href=#browsing-context>browsing context</a>
and that attempt is not currently running the <a href=#unload-a-document>unload a
document</a> algorithm, cancel that <a href=#navigate title=navigate>navigation</a> and any associated instances of
the <a href=#fetch title=fetch>fetch algorithm</a>. Otherwise, it must
do nothing.</p>
document</a> algorithm, cancel that <a href=#navigate title=navigate>navigation</a>; then, it must <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> of the <code><a href=#window>Window</a></code> object on
which it was invoked.</p>

</div>

<p>Once the user agent <dfn id=stop-parsing title="stop parsing">stops parsing</dfn>
the document, the user agent must run the following steps:</p>

<ol><!-- this happens as part of one of the tasks that runs the parser --><li><p>Set the <a href=#current-document-readiness>current document readiness</a> to
"<code title="">interactive</code>" <!-- this also synchronously fires an event --> and
the <a href=#insertion-point>insertion point</a> to undefined.</li>
<ol><!-- this happens as part of one of the tasks that runs the parser --><li><p>Set the <a href=#current-document-readiness>current document readiness</a> to "<code title="">interactive</code>" <!-- this also synchronously fires an
event --> and the <a href=#insertion-point>insertion point</a> to
undefined.</li>

<li><p>Pop <em>all</em> the nodes off the <a href=#stack-of-open-elements>stack of open
elements</a>.</li>
<li><p>Pop <em>all</em> the nodes off the <a href=#stack-of-open-elements>stack of open
elements</a>.</li>

<li><p>Set the <a href=#current-document-readiness>current document readiness</a> to "<code title="">interactive</code>"<!-- this synchronously fires an event
-->.</li>

<li><p>Set the <a href=#current-document-readiness>current document readiness</a> to "<code title="">complete</code>"<!-- this also synchronously fires an
event -->.</li>

<!-- anything else? this is things that happen when you call
document.open() on a document that's still being parsed, or when
you navigate a document that's still parsing, or navigate the
76 index

<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 9 July 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 10 July 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>
<code><a href=#document>Document</a></code> was created.</p>

<p>A <code><a href=#document>Document</a></code> object that falls into one of the
following conditions is a <dfn id=cookie-free-document-object>cookie-free <code>Document</code>
following conditions is a <dfn id=cookie-averse-document-object>cookie-averse <code>Document</code>
object</dfn>:</p>

<ul><li>A <code><a href=#document>Document</a></code> that has no <a href=#browsing-context>browsing
authority.</li>

</ul><!--Other specifications can also define <code>Document</code>
objects as being <span title="cookie-free Document
object">cookie-free <code>Document</code> objects</span>.--><p id=sandboxCookies>On getting, if the document is a
<a href=#cookie-free-document-object>cookie-free <code>Document</code> object</a>, then the user
agent must return the empty string. Otherwise, if the
objects as being <span title="cookie-averse Document
object">cookie-averse <code>Document</code> objects</span>.--><p id=sandboxCookies>On getting, if the document is a
<a href=#cookie-averse-document-object>cookie-averse <code>Document</code> object</a>, then the
user agent must return the empty string. Otherwise, if the
<code><a href=#document>Document</a></code>'s <a href=#origin>origin</a> is not a
scheme/host/port tuple, the user agent must throw a
<code><a href=#securityerror>SecurityError</a></code> exception. Otherwise, the user agent must
"non-HTTP" API, <a href=#decoded-as-utf-8,-with-error-handling>decoded as UTF-8, with error handling</a>.
<a href=#refsCOOKIES>[COOKIES]</a></p>

<p>On setting, if the document is a <a href=#cookie-free-document-object>cookie-free
<p>On setting, if the document is a <a href=#cookie-averse-document-object>cookie-averse
<code>Document</code> object</a>, then the user agent must do
nothing. Otherwise, if the <code><a href=#document>Document</a></code>'s
<a href=#origin>origin</a> is not a scheme/host/port tuple, the user agent

<p>Each document has a <dfn id=current-document-readiness>current document readiness</dfn>. When a
<code><a href=#document>Document</a></code> object is created, it must have its
<a href=#current-document-readiness>current document readiness</a> set to the string "<code title="">loading</code>"
if the document is associated with an <a href=#html-parser>HTML parser</a> or an
<a href=#xml-parser>XML parser</a>, or to the string "<code title="">complete</code>" otherwise.
Various algorithms during page loading affect this value. When the
value is set, the user agent must <a href=#fire-a-simple-event>fire a simple event</a>
named <dfn id=event-readystatechange title=event-readystatechange><code>readystatechange</code></dfn>
<a href=#current-document-readiness>current document readiness</a> set to the string "<code title="">loading</code>" if the document is associated with an
<a href=#html-parser>HTML parser</a>, an <a href=#xml-parser>XML parser</a>, or an XSLT
processor, and to the string "<code title="">complete</code>"
otherwise. Various algorithms during page loading affect this value.
When the value is set, the user agent must <a href=#fire-a-simple-event>fire a simple
event</a> named <dfn id=event-readystatechange title=event-readystatechange><code>readystatechange</code></dfn>
at the <code><a href=#document>Document</a></code> object.</p>

<p>A <code><a href=#document>Document</a></code> is said to have an <dfn id=active-parser>active
unaffected.) <a href=#refsXSLT10>[XSLT10]</a></p> <!-- note:
version matters for this ref -->

<p class=note>There are also additional comments regarding the
interaction of XSLT and HTML <a href=#scriptTagXSLT>in the
<code>script</code> element section</a>.</p>
<hr><p>This specification does not specify precisely how XSLT processing
interacts with the <a href=#html-parser>HTML parser</a> infrastructure (for
example, whether an XSLT processor acts as if it puts any elements
into a <a href=#stack-of-open-elements>stack of open elements</a>). However, XSLT
processors must <a href=#stop-parsing>stop parsing</a> if they successfully
complete, and must set the <a href=#current-document-readiness>current document readiness</a>
first to "<code title="">interactive</code>"<!-- this synchronously
fires an event --> and then to "<code title="">complete</code>"<!--
this also synchronously fires an event --> if they are aborted.</p>

<hr><p>This specification does not specify how XSLT interacts with the
<a href=#navigate title=navigate>navigation</a> algorithm, how it fits in
with the <a href=#event-loop>event loop</a>, nor how error pages are to be
handled (e.g. whether XSLT errors are to replace an incremental XSLT
output, or are rendered inline, etc).</p>

<p class=note>There are also additional non-normative comments
regarding the interaction of XSLT and HTML <a href=#scriptTagXSLT>in the <code>script</code> element
section</a>.</p>

</div>

<p><i>This section is non-normative.</i></p>

<p>This specification does not define how XSLT interacts with the
<code><a href=#the-script-element>script</a></code> element (or, indeed, how XSLT processing
triggers the <a href=#stop-parsing>stop parsing</a> steps, how it interacts with
the <a href=#navigate title=navigate>navigation</a> algorithm, or how it
fits in with the <a href=#event-loop>event loop</a>). However, in the absence
of another specification actually defining this, here are some
guidelines for implementors, based on existing implementations:</p>
<code><a href=#the-script-element>script</a></code> element. However, in the absence of another
specification actually defining this, here are some guidelines for
implementors, based on existing implementations:</p>

<ul><li><p>When an XSLT transformation program is triggered by an <code title="">&lt;?xml-stylesheet?&gt;</code> processing instruction and
the browser implements a direct-to-DOM transformation,
on <code><a href=#window>Window</a></code> objects should, if there is an existing
attempt to <a href=#navigate>navigate</a> the <a href=#browsing-context>browsing context</a>
and that attempt is not currently running the <a href=#unload-a-document>unload a
document</a> algorithm, cancel that <a href=#navigate title=navigate>navigation</a> and any associated instances of
the <a href=#fetch title=fetch>fetch algorithm</a>. Otherwise, it must
do nothing.</p>
document</a> algorithm, cancel that <a href=#navigate title=navigate>navigation</a>; then, it must <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> of the <code><a href=#window>Window</a></code> object on
which it was invoked.</p>

</div>

<p>Once the user agent <dfn id=stop-parsing title="stop parsing">stops parsing</dfn>
the document, the user agent must run the following steps:</p>

<ol><!-- this happens as part of one of the tasks that runs the parser --><li><p>Set the <a href=#current-document-readiness>current document readiness</a> to
"<code title="">interactive</code>" <!-- this also synchronously fires an event --> and
the <a href=#insertion-point>insertion point</a> to undefined.</li>
<ol><!-- this happens as part of one of the tasks that runs the parser --><li><p>Set the <a href=#current-document-readiness>current document readiness</a> to "<code title="">interactive</code>" <!-- this also synchronously fires an
event --> and the <a href=#insertion-point>insertion point</a> to
undefined.</li>

<li><p>Pop <em>all</em> the nodes off the <a href=#stack-of-open-elements>stack of open
elements</a>.</li>
<li><p>Pop <em>all</em> the nodes off the <a href=#stack-of-open-elements>stack of open
elements</a>.</li>

<li><p>Set the <a href=#current-document-readiness>current document readiness</a> to "<code title="">interactive</code>"<!-- this synchronously fires an event
-->.</li>

<li><p>Set the <a href=#current-document-readiness>current document readiness</a> to "<code title="">complete</code>"<!-- this also synchronously fires an
event -->.</li>

<!-- anything else? this is things that happen when you call
document.open() on a document that's still being parsed, or when
you navigate a document that's still parsing, or navigate the

0 comments on commit dbf9299

Please sign in to comment.
You can’t perform that action at this time.