Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 dbf9299
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 84 deletions.
76 changes: 48 additions & 28 deletions complete.html
Expand Up @@ -240,7 +240,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 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>
Expand Down Expand Up @@ -10069,7 +10069,7 @@ <h4 id=resource-metadata-management><span class=secno>3.1.3 </span><dfn>Resource
<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
Expand All @@ -10080,10 +10080,10 @@ <h4 id=resource-metadata-management><span class=secno>3.1.3 </span><dfn>Resource
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
Expand All @@ -10092,7 +10092,7 @@ <h4 id=resource-metadata-management><span class=secno>3.1.3 </span><dfn>Resource
"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
Expand Down Expand Up @@ -10175,12 +10175,12 @@ <h4 id=resource-metadata-management><span class=secno>3.1.3 </span><dfn>Resource

<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
Expand Down Expand Up @@ -13659,9 +13659,25 @@ <h3 id=interactions-with-xpath-and-xslt><span class=secno>3.3 </span>Interaction
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>

Expand Down Expand Up @@ -17274,12 +17290,9 @@ <h5 id=scriptTagXSLT><span class=secno>4.3.1.4 </span>Interaction of <code><a hr
<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,
Expand Down Expand Up @@ -65992,9 +66005,10 @@ <h4 id=apis-for-creating-and-navigating-browsing-contexts-by-name><span class=se
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>

Expand Down Expand Up @@ -93129,9 +93143,9 @@ <h4 id=the-end><span class=secno>12.2.6 </span>The end</h4>
<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>
Expand Down Expand Up @@ -93227,6 +93241,12 @@ <h4 id=the-end><span class=secno>12.2.6 </span>The end</h4>
<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
Expand Down
76 changes: 48 additions & 28 deletions index
Expand Up @@ -240,7 +240,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 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>
Expand Down Expand Up @@ -10069,7 +10069,7 @@ partial interface <dfn id=document>Document</dfn> {
<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
Expand All @@ -10080,10 +10080,10 @@ partial interface <dfn id=document>Document</dfn> {
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
Expand All @@ -10092,7 +10092,7 @@ partial interface <dfn id=document>Document</dfn> {
"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
Expand Down Expand Up @@ -10175,12 +10175,12 @@ partial interface <dfn id=document>Document</dfn> {

<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
Expand Down Expand Up @@ -13659,9 +13659,25 @@ plaintext = *( %x0000-2029 / %x202F-10FFFF )
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>

Expand Down Expand Up @@ -17274,12 +17290,9 @@ not-slash = %x0000-002E / %x0030-10FFFF
<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,
Expand Down Expand Up @@ -65992,9 +66005,10 @@ interface <dfn id=window>Window</dfn> : <a href=#eventtarget>EventTarget</a> {
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>

Expand Down Expand Up @@ -93129,9 +93143,9 @@ document.body.appendChild(text);
<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>
Expand Down Expand Up @@ -93227,6 +93241,12 @@ document.body.appendChild(text);
<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
Expand Down

0 comments on commit dbf9299

Please sign in to comment.