Skip to content

Commit

Permalink
[e] (0) Try to warn implementors about XSLT.
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11090

git-svn-id: http://svn.whatwg.org/webapps@6049 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 3, 2011
1 parent a447bad commit e7303de
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 42 deletions.
83 changes: 68 additions & 15 deletions complete.html
Expand Up @@ -239,7 +239,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">Living Standard &mdash; Last Updated 2 May 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 3 May 2011</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 @@ -482,7 +482,8 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
<ol>
<li><a href=#scriptingLanguages><span class=secno>4.3.1.1 </span>Scripting languages</a></li>
<li><a href=#restrictions-for-contents-of-script-elements><span class=secno>4.3.1.2 </span>Restrictions for contents of <code>script</code> elements</a></li>
<li><a href=#inline-documentation-for-external-scripts><span class=secno>4.3.1.3 </span>Inline documentation for external scripts</a></ol></li>
<li><a href=#inline-documentation-for-external-scripts><span class=secno>4.3.1.3 </span>Inline documentation for external scripts</a></li>
<li><a href=#scriptTagXSLT><span class=secno>4.3.1.4 </span>Interaction of <code>script</code> elements and XSLT</a></ol></li>
<li><a href=#the-noscript-element><span class=secno>4.3.2 </span>The <code>noscript</code> element</a></ol></li>
<li><a href=#sections><span class=secno>4.4 </span>Sections</a>
<ol>
Expand Down Expand Up @@ -3358,6 +3359,8 @@ <h4 id=dependencies><span class=secno>2.2.2 </span>Dependencies</h4>
<li><dfn id=text><code>Text</code></dfn> interface</li>

<li><dfn id=dom-domimplementation-createdocument title=dom-DOMImplementation-createDocument><code>createDocument()</code></dfn> method</li>
<li><dfn id=dom-document-createelement title=dom-Document-createElement><code>createElement()</code></dfn> method</li>
<li><dfn id=dom-document-createelementns title=dom-Document-createElementNS><code>createElementNS()</code></dfn> method</li>
<li><dfn id=dom-document-getelementbyid title=dom-Document-getElementById><code>getElementById()</code></dfn> method</li>
<li><dfn id=dom-node-insertbefore title=dom-Node-insertBefore><code>insertBefore()</code></dfn> method</li>

Expand Down Expand Up @@ -12120,7 +12123,7 @@ <h3 id=apis-in-html-documents><span class=secno>3.3 </span>APIs in HTML document
</dd>


<dt><code title=dom-Document-createElement>Document.createElement()</code></dt>
<dt><code title=dom-Document-createElement><a href=#dom-document-createelement>Document.createElement()</a></code></dt>

<dd>

Expand All @@ -12129,13 +12132,14 @@ <h3 id=apis-in-html-documents><span class=secno>3.3 </span>APIs in HTML document
the argument before creating the requisite element. <span class=impl>Also, the element created must be in the <a href=#html-namespace-0>HTML
namespace</a></span>.</p>

<p class=note>This doesn't apply to <code title="">Document.createElementNS()</code>. Thus, it is possible,
by passing this last method a tag name in the wrong case, to
create an element that appears to have the same tag name as that
of an element defined in this specification when its <code title=dom-Element-tagName><a href=#dom-element-tagname>tagName</a></code> attribute is examined, but that
doesn't support the corresponding interfaces. The "real" element
name (unaffected by case conversions) can be obtained from the
<code title=dom-Node-localName><a href=#dom-node-localname>localName</a></code> attribute.</p>
<p class=note>This doesn't apply to <code title=dom-Document-createElementNS><a href=#dom-document-createelementns>Document.createElementNS()</a></code>.
Thus, it is possible, by passing this last method a tag name in
the wrong case, to create an element that appears to have the same
tag name as that of an element defined in this specification when
its <code title=dom-Element-tagName><a href=#dom-element-tagname>tagName</a></code> attribute is
examined, but that doesn't support the corresponding interfaces.
The "real" element name (unaffected by case conversions) can be
obtained from the <code title=dom-Node-localName><a href=#dom-node-localname>localName</a></code> attribute.</p>

</dd>

Expand Down Expand Up @@ -12301,6 +12305,10 @@ <h3 id=interactions-with-xpath-and-xslt><span class=secno>3.4 </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>

</div>


Expand Down Expand Up @@ -15459,11 +15467,9 @@ <h4 id=script><span class=secno>4.3.1 </span>The <dfn><code>script</code></dfn>
<p class=note>The definition of <a href=#concept-n-noscript title=concept-n-noscript>scripting is disabled</a> means
that, amongst others, the following scripts will not execute:
scripts in <code>XMLHttpRequest</code>'s <code title=dom-XMLHttpRequest-responseXML>responseXML</code>
documents, scripts in <code>DOMParser</code>-created
documents, <!--scripts in documents created by
<code>XSLTProcessor</code>'s <code
title="dom-XSLTProcessor-transformToDocument">transformToDocument</code>
feature,--> and scripts that are first inserted by a script into a
documents, scripts in <code>DOMParser</code>-created documents,
scripts in documents created by <code>XSLTProcessor</code>'s <code title=dom-XSLTProcessor-transformToDocument>transformToDocument</code>
feature, and scripts that are first inserted by a script into a
<code><a href=#document>Document</a></code> that was created using the <code title=dom-DOMImplementation-createDocument><a href=#dom-domimplementation-createdocument>createDocument()</a></code>
API. <a href=#refsXHR>[XHR]</a> <a href=#refsDOMPARSER>[DOMPARSER]</a> <!--<a
href="#refsXSLTP">[XSLTP]</a>--> <a href=#refsDOMCORE>[DOMCORE]</a></p>
Expand Down Expand Up @@ -16163,6 +16169,53 @@ <h5 id=inline-documentation-for-external-scripts><span class=secno>4.3.1.3 </spa
</div>


<div class=impl>

<h5 id=scriptTagXSLT><span class=secno>4.3.1.4 </span>Interaction of <code><a href=#script>script</a></code> elements and XSLT</h5>

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

<p>This specification does not define how XSLT interacts with the
<code><a href=#script>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>

<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,
<code><a href=#script>script</a></code> elements created by the XSLT processor need to
be marked <a href=#parser-inserted>"parser-inserted"</a> and run in document order
(modulo scripts marked <code title=attr-script-defer><a href=#attr-script-defer>defer</a></code>
or <code title=attr-script-async><a href=#attr-script-async>async</a></code>), asynchronously
while the transformation is occurring.</li>

<li><p>The <code title=dom-XSLTProcessor-transformToDocument>XSLTProcessor.transformToDocument()</code>
method adds elements to a <code><a href=#document>Document</a></code> that is not in a
<a href=#browsing-context>browsing context</a>, and, accordingly, any
<code><a href=#script>script</a></code> elements they create need to have their
<a href=#already-started>"already started"</a> flag set in the <a href=#prepare-a-script>prepare a
script</a> algorithm and never get executed (<a href=#concept-bc-noscript title=concept-bc-noscript>scripting is disabled</a>). Such
<code><a href=#script>script</a></code> elements still need to be marked
<a href=#parser-inserted>"parser-inserted"</a>, though, such that their <code title=dom-script-async><a href=#dom-script-async>async</a></code> IDL attribute will return
false in the absence of an <code title=attr-script-async><a href=#attr-script-async>async</a></code> content attribute.</li>

<li><p>The <code title=dom-XSLTProcessor-transformToFragment>XSLTProcessor.transformToFragment()</code>
method needs to create a fragment that is equivalent to one built
manually by creating the elements using <code title=dom-document-createElementNS><a href=#dom-document-createelementns>document.createElementNS()</a></code>.
For instance, it needs to create <code><a href=#script>script</a></code> elements that
aren't <a href=#parser-inserted>"parser-inserted"</a> and that don't have their
<a href=#already-started>"already started"</a> flag set, so that they will execute
when the fragment is inserted into a document.</li>

</ul><p>The main distinction between the first two cases and the last
case is that the first two operate on <code><a href=#document>Document</a></code>s and the
last operates on a fragment.</p>

</div>



<h4 id=the-noscript-element><span class=secno>4.3.2 </span>The <dfn><code>noscript</code></dfn> element</h4>

Expand Down
83 changes: 68 additions & 15 deletions index
Expand Up @@ -243,7 +243,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 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 2 May 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 3 May 2011</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 @@ -490,7 +490,8 @@
<ol>
<li><a href=#scriptingLanguages><span class=secno>4.3.1.1 </span>Scripting languages</a></li>
<li><a href=#restrictions-for-contents-of-script-elements><span class=secno>4.3.1.2 </span>Restrictions for contents of <code>script</code> elements</a></li>
<li><a href=#inline-documentation-for-external-scripts><span class=secno>4.3.1.3 </span>Inline documentation for external scripts</a></ol></li>
<li><a href=#inline-documentation-for-external-scripts><span class=secno>4.3.1.3 </span>Inline documentation for external scripts</a></li>
<li><a href=#scriptTagXSLT><span class=secno>4.3.1.4 </span>Interaction of <code>script</code> elements and XSLT</a></ol></li>
<li><a href=#the-noscript-element><span class=secno>4.3.2 </span>The <code>noscript</code> element</a></ol></li>
<li><a href=#sections><span class=secno>4.4 </span>Sections</a>
<ol>
Expand Down Expand Up @@ -3383,6 +3384,8 @@ explained in the previous section, which talks about RFC 2119. -->
<li><dfn id=text><code>Text</code></dfn> interface</li>

<li><dfn id=dom-domimplementation-createdocument title=dom-DOMImplementation-createDocument><code>createDocument()</code></dfn> method</li>
<li><dfn id=dom-document-createelement title=dom-Document-createElement><code>createElement()</code></dfn> method</li>
<li><dfn id=dom-document-createelementns title=dom-Document-createElementNS><code>createElementNS()</code></dfn> method</li>
<li><dfn id=dom-document-getelementbyid title=dom-Document-getElementById><code>getElementById()</code></dfn> method</li>
<li><dfn id=dom-node-insertbefore title=dom-Node-insertBefore><code>insertBefore()</code></dfn> method</li>

Expand Down Expand Up @@ -12145,7 +12148,7 @@ plaintext = *( %x0000-2029 / %x202F-10FFFF )
</dd>


<dt><code title=dom-Document-createElement>Document.createElement()</code></dt>
<dt><code title=dom-Document-createElement><a href=#dom-document-createelement>Document.createElement()</a></code></dt>

<dd>

Expand All @@ -12154,13 +12157,14 @@ plaintext = *( %x0000-2029 / %x202F-10FFFF )
the argument before creating the requisite element. <span class=impl>Also, the element created must be in the <a href=#html-namespace-0>HTML
namespace</a></span>.</p>

<p class=note>This doesn't apply to <code title="">Document.createElementNS()</code>. Thus, it is possible,
by passing this last method a tag name in the wrong case, to
create an element that appears to have the same tag name as that
of an element defined in this specification when its <code title=dom-Element-tagName><a href=#dom-element-tagname>tagName</a></code> attribute is examined, but that
doesn't support the corresponding interfaces. The "real" element
name (unaffected by case conversions) can be obtained from the
<code title=dom-Node-localName><a href=#dom-node-localname>localName</a></code> attribute.</p>
<p class=note>This doesn't apply to <code title=dom-Document-createElementNS><a href=#dom-document-createelementns>Document.createElementNS()</a></code>.
Thus, it is possible, by passing this last method a tag name in
the wrong case, to create an element that appears to have the same
tag name as that of an element defined in this specification when
its <code title=dom-Element-tagName><a href=#dom-element-tagname>tagName</a></code> attribute is
examined, but that doesn't support the corresponding interfaces.
The "real" element name (unaffected by case conversions) can be
obtained from the <code title=dom-Node-localName><a href=#dom-node-localname>localName</a></code> attribute.</p>

</dd>

Expand Down Expand Up @@ -12326,6 +12330,10 @@ 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>

</div>


Expand Down Expand Up @@ -15484,11 +15492,9 @@ c-end = "--&gt;"</pre>
<p class=note>The definition of <a href=#concept-n-noscript title=concept-n-noscript>scripting is disabled</a> means
that, amongst others, the following scripts will not execute:
scripts in <code>XMLHttpRequest</code>'s <code title=dom-XMLHttpRequest-responseXML>responseXML</code>
documents, scripts in <code>DOMParser</code>-created
documents, <!--scripts in documents created by
<code>XSLTProcessor</code>'s <code
title="dom-XSLTProcessor-transformToDocument">transformToDocument</code>
feature,--> and scripts that are first inserted by a script into a
documents, scripts in <code>DOMParser</code>-created documents,
scripts in documents created by <code>XSLTProcessor</code>'s <code title=dom-XSLTProcessor-transformToDocument>transformToDocument</code>
feature, and scripts that are first inserted by a script into a
<code><a href=#document>Document</a></code> that was created using the <code title=dom-DOMImplementation-createDocument><a href=#dom-domimplementation-createdocument>createDocument()</a></code>
API. <a href=#refsXHR>[XHR]</a> <a href=#refsDOMPARSER>[DOMPARSER]</a> <!--<a
href="#refsXSLTP">[XSLTP]</a>--> <a href=#refsDOMCORE>[DOMCORE]</a></p>
Expand Down Expand Up @@ -16188,6 +16194,53 @@ not-slash = %x0000-002E / %x0030-10FFFF
</div>


<div class=impl>

<h5 id=scriptTagXSLT><span class=secno>4.3.1.4 </span>Interaction of <code><a href=#script>script</a></code> elements and XSLT</h5>

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

<p>This specification does not define how XSLT interacts with the
<code><a href=#script>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>

<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,
<code><a href=#script>script</a></code> elements created by the XSLT processor need to
be marked <a href=#parser-inserted>"parser-inserted"</a> and run in document order
(modulo scripts marked <code title=attr-script-defer><a href=#attr-script-defer>defer</a></code>
or <code title=attr-script-async><a href=#attr-script-async>async</a></code>), asynchronously
while the transformation is occurring.</li>

<li><p>The <code title=dom-XSLTProcessor-transformToDocument>XSLTProcessor.transformToDocument()</code>
method adds elements to a <code><a href=#document>Document</a></code> that is not in a
<a href=#browsing-context>browsing context</a>, and, accordingly, any
<code><a href=#script>script</a></code> elements they create need to have their
<a href=#already-started>"already started"</a> flag set in the <a href=#prepare-a-script>prepare a
script</a> algorithm and never get executed (<a href=#concept-bc-noscript title=concept-bc-noscript>scripting is disabled</a>). Such
<code><a href=#script>script</a></code> elements still need to be marked
<a href=#parser-inserted>"parser-inserted"</a>, though, such that their <code title=dom-script-async><a href=#dom-script-async>async</a></code> IDL attribute will return
false in the absence of an <code title=attr-script-async><a href=#attr-script-async>async</a></code> content attribute.</li>

<li><p>The <code title=dom-XSLTProcessor-transformToFragment>XSLTProcessor.transformToFragment()</code>
method needs to create a fragment that is equivalent to one built
manually by creating the elements using <code title=dom-document-createElementNS><a href=#dom-document-createelementns>document.createElementNS()</a></code>.
For instance, it needs to create <code><a href=#script>script</a></code> elements that
aren't <a href=#parser-inserted>"parser-inserted"</a> and that don't have their
<a href=#already-started>"already started"</a> flag set, so that they will execute
when the fragment is inserted into a document.</li>

</ul><p>The main distinction between the first two cases and the last
case is that the first two operate on <code><a href=#document>Document</a></code>s and the
last operates on a fragment.</p>

</div>



<h4 id=the-noscript-element><span class=secno>4.3.2 </span>The <dfn><code>noscript</code></dfn> element</h4>

Expand Down

0 comments on commit e7303de

Please sign in to comment.