Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 6 additions & 119 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2033,12 +2033,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
so that users can interact with them, unless the semantics of those elements have been
overridden by other specifications.</p>

<p class="example">A conforming web browser would, upon finding a <code>script</code> element in
an XML document, execute the script contained in that element. However, if the element is found
within a transformation expressed in XSLT (assuming the user agent also supports XSLT), then the
processor would instead treat the <code>script</code> element as an opaque element that forms
part of the transform.</p>

<p>Web browsers that support <span>the HTML syntax</span> must process documents labeled with an
<span>HTML MIME type</span> as described in this specification, so that users can interact with
them.</p>
Expand Down Expand Up @@ -2432,12 +2426,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
data-x-href="https://www.w3.org/TR/xml-stylesheet/#the-xml-stylesheet-processing-instruction"><code>&lt;?xml-stylesheet?></code></dfn>
processing instruction, defined in <cite>Associating Style Sheets with XML documents</cite>.
<ref>XMLSSPI</ref></p>

<p>This specification also non-normatively mentions the <dfn><code>XSLTProcessor</code></dfn>
interface and its <dfn><code
data-x="dom-XSLTProcessor-transformToFragment">transformToFragment()</code></dfn> and <dfn><code
data-x="dom-XSLTProcessor-transformToDocument">transformToDocument()</code></dfn> methods.
<ref>XSLTP</ref></p>
</dd>


Expand Down Expand Up @@ -5032,7 +5020,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

<div w-nodev>

<h4>Interactions with XPath and XSLT</h4>
<h4 id="interactions-with-xpath-and-xslt">Interactions with XPath</h4>

<p id="xpath-1.0-processors">Implementations of XPath 1.0 that operate on <span>HTML
documents</span> parsed or created in the manners described in this specification (e.g. as part of
Expand Down Expand Up @@ -5094,45 +5082,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
used for HTML elements. <ref>XPATH10</ref></p> <!-- note: version matters for
this ref -->

<hr>

<p id="dom-based-xslt-1.0-processors">XSLT 1.0 processors outputting to a DOM when the output
method is "html" (either explicitly or via the defaulting rule in XSLT 1.0) are affected as
follows:</p>

<p>If the transformation program outputs an element in no namespace, the processor must, prior to
constructing the corresponding DOM element node, change the namespace of the element to the
<span>HTML namespace</span>, <span data-x="converted to ASCII lowercase">ASCII-lowercase</span> the
element's local name, and <span data-x="converted to ASCII lowercase">ASCII-lowercase</span> the
names of any non-namespaced attributes on the element.</p>

<p class="note">This requirement is a <span>willful violation</span> of the XSLT 1.0
specification, required because this specification changes the namespaces and case-sensitivity
rules of HTML in a manner that would otherwise be incompatible with DOM-based XSLT
transformations. (Processors that serialize the output are unaffected.) <ref>XSLT10</ref></p> <!--
note: version matters for this ref -->

<hr>

<p>This specification does not specify precisely how XSLT processing interacts with the <span>HTML
parser</span> infrastructure (for example, whether an XSLT processor acts as if it puts any
elements into a <span>stack of open elements</span>). However, XSLT processors must <span>stop
parsing</span> if they successfully complete, and must <span>update the current document
readiness</span> first to "<code data-x="">interactive</code>" and then to "<code
data-x="">complete</code>" if they are aborted.</p>

<hr>

<p>This specification does not specify how XSLT interacts with the <span
data-x="navigate">navigation</span> algorithm, how it fits in with the <span>event loop</span>, 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>, and of
XSLT, XPath, and HTML <a href="#template-XSLT-XPath">in the <code>template</code> element
section</a>.</p>

</div>


Expand Down Expand Up @@ -12469,7 +12418,7 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {
<p>The nodes representing <span>HTML elements</span> in the DOM <span w-nodev>must</span>
implement, and expose to scripts, the interfaces listed for them in the relevant sections of this
specification. This includes <span>HTML elements</span> in <span>XML documents</span>, even when
those documents are in another context (e.g. inside an XSLT transform).</p>
those documents are in another context.</p>

<p>Elements in the DOM <dfn data-x="represents">represent</dfn> things; that is, they have
intrinsic <em>meaning</em>, also known as semantics.</p>
Expand Down Expand Up @@ -66835,12 +66784,10 @@ document.body.append(script1, script2);
<p class="note">The definition of <span data-x="concept-n-noscript">scripting is
disabled</span> means that, amongst others, the following scripts will not execute: scripts in
<code>XMLHttpRequest</code>'s <code data-x="dom-XMLHttpRequest-responseXML">responseXML</code>
documents, scripts in <code>DOMParser</code>-created documents, scripts in documents created by
<code>XSLTProcessor</code>'s <code
data-x="dom-XSLTProcessor-transformToDocument">transformToDocument</code> feature, and scripts
documents, scripts in <code>DOMParser</code>-created documents, and scripts
that are first inserted by a script into a <code>Document</code> that was created using the
<code data-x="dom-DOMImplementation-createDocument">createDocument()</code> API. <ref>XHR</ref>
<ref>DOMPARSING</ref> <ref>XSLTP</ref> <ref>DOM</ref></p>
<ref>DOMPARSING</ref> <ref>DOM</ref></p>
</li>

<li>
Expand Down Expand Up @@ -67593,52 +67540,6 @@ not-slash = %x0000-002E / %x0030-10FFFF
</div>


<div w-nodev>

<h5 id="scriptTagXSLT">Interaction of <code>script</code> elements and XSLT</h5>

<!-- NON-NORMATIVE SECTION -->

<p>This specification does not define how XSLT interacts with the <code>script</code> element.
However, in the absence of another specification actually defining this, here are some guidelines
for implementers, based on existing implementations:</p>

<ul>
<li><p>When an XSLT transformation program is triggered by an <code
data-x="">&lt;?xml-stylesheet?></code> processing instruction and the browser implements a
direct-to-DOM transformation, <code>script</code> elements created by the XSLT processor need to
have its <span>parser document</span> set correctly, and run in document order (modulo scripts
marked <code data-x="attr-script-defer">defer</code> or <code
data-x="attr-script-async">async</code>), <span>immediately</span>, as the transformation is
occurring.</p></li>

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

<li><p>The <code>XSLTProcessor</code> <code
data-x="dom-XSLTProcessor-transformToFragment">transformToFragment()</code> method needs to
create a fragment that is equivalent to one built manually by creating the elements using <code
data-x="dom-document-createElementNS">document.createElementNS()</code>. For instance, it needs
to create <code>script</code> elements with null <span>parser document</span> and with their
<span>already started</span> set to false, so that they will execute when the fragment is
inserted into a document.</p></li>
</ul>

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

</div>



<h4>The <dfn element><code>noscript</code></dfn> element</h4>

<dl class="element">
Expand Down Expand Up @@ -68128,24 +68029,16 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {

<div w-nodev>

<h5 id="template-XSLT-XPath">Interaction of <code>template</code> elements with XSLT and XPath</h5>
<h5 id="template-XSLT-XPath">Interaction of <code>template</code> elements with XPath</h5>

<!-- NON-NORMATIVE SECTION -->

<p>This specification does not define how XSLT and XPath interact with the <code>template</code>
<p>This specification does not define how XPath interacts with the <code>template</code>
element. However, in the absence of another specification actually defining this, here are some
guidelines for implementers, which are intended to be consistent with other processing described
in this specification:</p>

<ul>
<li><p>An XSLT processor based on an XML parser that acts <span data-x="xml parser">as described
in this specification</span> needs to act as if <code>template</code> elements contain as
descendants their <span>template contents</span> for the purposes of the transform.</p></li>

<li><p>An XSLT processor that outputs a DOM needs to ensure that nodes that would go into a
<code>template</code> element are instead placed into the element's <span>template
contents</span>.</p></li>

<li><p>XPath evaluation using the XPath DOM API when applied to a <code>Document</code> parsed
using the <span>HTML parser</span> or the <span>XML parser</span> described in this specification
needs to ignore <span>template contents</span>.</p>
Expand Down Expand Up @@ -155780,12 +155673,6 @@ INSERT INTERFACES HERE

<dt id="refsXPATH10">[XPATH10]</dt>
<dd><cite><a href="https://www.w3.org/TR/1999/REC-xpath-19991116/">XML Path Language (XPath) Version 1.0</a></cite>, J. Clark, S. DeRose. W3C.</dd>

<dt id="refsXSLT10">[XSLT10]</dt>
<dd>(Non-normative) <cite><a href="https://www.w3.org/TR/1999/REC-xslt-19991116">XSL Transformations (XSLT) Version 1.0</a></cite>, J. Clark. W3C.</dd>

<dt id="refsXSLTP">[XSLTP]</dt>
<dd>(Non-normative) <cite><a href="https://wiki.whatwg.org/wiki/DOM_XSLTProcessor">DOM XSLTProcessor</a></cite>, WHATWG Wiki. WHATWG.</dd>
</dl>


Expand Down