Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[e] (0) Provide a way for other specs to invoke the XML parser withou…
…t scripting enabled

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=26145
Affected topics: HTML Syntax and Parsing

git-svn-id: http://svn.whatwg.org/webapps@8728 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 28, 2014
1 parent 7d3b61c commit c1f5393
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
23 changes: 15 additions & 8 deletions complete.html
Expand Up @@ -76671,7 +76671,7 @@ <h3 id=parsing-xhtml-documents>13.2 Parsing XHTML documents</h3>
parsed or the parser detects a well-formedness error, the user agent must act as if the element
was in a <a href=#stack-of-open-elements id=parsing-xhtml-documents:stack-of-open-elements>stack of open elements</a>.</p>

<p class=note>This is used by the <code id=parsing-xhtml-documents:the-object-element><a href=#the-object-element>object</a></code> element to avoid instantiating plugins
<p class=note>This is used, e.g. by the <code id=parsing-xhtml-documents:the-object-element><a href=#the-object-element>object</a></code> element to avoid instantiating plugins
before the <code id=parsing-xhtml-documents:the-param-element><a href=#the-param-element>param</a></code> element children have been parsed.</p>

<p>This specification provides the following additional information that user agents should use
Expand All @@ -76691,11 +76691,15 @@ <h3 id=parsing-xhtml-documents>13.2 Parsing XHTML documents</h3>
motivated by a desire for user agents to all handle entities in an interoperable fashion without
requiring any network access for handling external subsets. <a href=#refsXML>[XML]</a></p>

<p id=scriptTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-3>XML parser</a> creates a <code id=parsing-xhtml-documents:the-script-element><a href=#the-script-element>script</a></code> element, it
<p>XML parsers can be invoked with <dfn id=xml-scripting-support-enabled>XML scripting support enabled</dfn> or <dfn id=xml-scripting-support-disabled>disabled</dfn>. Except where otherwise specified, XML parsers are
invoked with <a href=#xml-scripting-support-enabled id=parsing-xhtml-documents:xml-scripting-support-enabled>XML scripting support enabled</a>.</p>

<p id=scriptTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-3>XML parser</a> with <a href=#xml-scripting-support-enabled id=parsing-xhtml-documents:xml-scripting-support-enabled-2>XML scripting support enabled</a>
creates a <code id=parsing-xhtml-documents:the-script-element><a href=#the-script-element>script</a></code> element, it
must be marked as being <a href=#parser-inserted id=parsing-xhtml-documents:parser-inserted>"parser-inserted"</a> and its <a href=#force-async id=parsing-xhtml-documents:force-async>"force-async"</a> flag
must be unset. If the parser was originally created for the <a href=#xml-fragment-parsing-algorithm id=parsing-xhtml-documents:xml-fragment-parsing-algorithm>XML fragment parsing
algorithm</a>, then the element must be marked as <a href=#already-started id=parsing-xhtml-documents:already-started>"already started"</a> also. When the
element's end tag is parsed, the user agent must <a href=#perform-a-microtask-checkpoint id=parsing-xhtml-documents:perform-a-microtask-checkpoint>perform a microtask checkpoint</a>, and
element's end tag is subsequently parsed, the user agent must <a href=#perform-a-microtask-checkpoint id=parsing-xhtml-documents:perform-a-microtask-checkpoint>perform a microtask checkpoint</a>, and
then <a href=#prepare-a-script id=parsing-xhtml-documents:prepare-a-script>prepare</a> the <code id=parsing-xhtml-documents:the-script-element-2><a href=#the-script-element>script</a></code> element. If this
causes there to be a <a href=#pending-parsing-blocking-script id=parsing-xhtml-documents:pending-parsing-blocking-script>pending parsing-blocking script</a>, then the user agent must run
the following steps:</p>
Expand All @@ -76710,24 +76714,27 @@ <h3 id=parsing-xhtml-documents>13.2 Parsing XHTML documents</h3>
available for <a href=#xml-documents id=parsing-xhtml-documents:xml-documents>XML documents</a>, much of the complexity in the <a href=#html-parser id=parsing-xhtml-documents:html-parser>HTML parser</a>
is not needed in the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-6>XML parser</a>.</p>

<p id=templateTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-7>XML parser</a> would append a node to a
<p class=note>When the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-7>XML parser</a> has <a href=#xml-scripting-support-disabled id=parsing-xhtml-documents:xml-scripting-support-disabled>XML scripting support disabled</a>,
none of this happens.</p>

<p id=templateTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-8>XML parser</a> would append a node to a
<code id=parsing-xhtml-documents:the-template-element><a href=#the-template-element>template</a></code> element, it must instead append it to the <code id=parsing-xhtml-documents:the-template-element-2><a href=#the-template-element>template</a></code> element's
<a href=#template-contents id=parsing-xhtml-documents:template-contents>template contents</a> (a <code id=parsing-xhtml-documents:documentfragment><a href=#documentfragment>DocumentFragment</a></code> node).</p>

<p class=note>This is a <a href=#willful-violation id=parsing-xhtml-documents:willful-violation-2>willful violation</a> of the XML specification; unfortunately,
XML is not formally extensible in the manner that is needed for <code id=parsing-xhtml-documents:the-template-element-3><a href=#the-template-element>template</a></code> processing.
<a href=#refsXML>[XML]</a></p>

<p>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-8>XML parser</a> creates a <code id=parsing-xhtml-documents:node><a href=#node>Node</a></code> object, its <code id=parsing-xhtml-documents:dom-node-ownerdocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> must be set to the <code id=parsing-xhtml-documents:document-6><a href=#document>Document</a></code> of
<p>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-9>XML parser</a> creates a <code id=parsing-xhtml-documents:node><a href=#node>Node</a></code> object, its <code id=parsing-xhtml-documents:dom-node-ownerdocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> must be set to the <code id=parsing-xhtml-documents:document-6><a href=#document>Document</a></code> of
the node into which the newly created node is to be inserted.</p>

<p>Certain algorithms in this specification <dfn id=feed-the-parser>spoon-feed the
parser</dfn> characters one string at a time. In such cases, the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-9>XML parser</a> must act
parser</dfn> characters one string at a time. In such cases, the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-10>XML parser</a> must act
as it would have if faced with a single string consisting of the concatenation of all those
characters.</p>

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

Expand Down
23 changes: 15 additions & 8 deletions index
Expand Up @@ -76671,7 +76671,7 @@ document.body.appendChild(text);
parsed or the parser detects a well-formedness error, the user agent must act as if the element
was in a <a href=#stack-of-open-elements id=parsing-xhtml-documents:stack-of-open-elements>stack of open elements</a>.</p>

<p class=note>This is used by the <code id=parsing-xhtml-documents:the-object-element><a href=#the-object-element>object</a></code> element to avoid instantiating plugins
<p class=note>This is used, e.g. by the <code id=parsing-xhtml-documents:the-object-element><a href=#the-object-element>object</a></code> element to avoid instantiating plugins
before the <code id=parsing-xhtml-documents:the-param-element><a href=#the-param-element>param</a></code> element children have been parsed.</p>

<p>This specification provides the following additional information that user agents should use
Expand All @@ -76691,11 +76691,15 @@ document.body.appendChild(text);
motivated by a desire for user agents to all handle entities in an interoperable fashion without
requiring any network access for handling external subsets. <a href=#refsXML>[XML]</a></p>

<p id=scriptTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-3>XML parser</a> creates a <code id=parsing-xhtml-documents:the-script-element><a href=#the-script-element>script</a></code> element, it
<p>XML parsers can be invoked with <dfn id=xml-scripting-support-enabled>XML scripting support enabled</dfn> or <dfn id=xml-scripting-support-disabled>disabled</dfn>. Except where otherwise specified, XML parsers are
invoked with <a href=#xml-scripting-support-enabled id=parsing-xhtml-documents:xml-scripting-support-enabled>XML scripting support enabled</a>.</p>

<p id=scriptTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-3>XML parser</a> with <a href=#xml-scripting-support-enabled id=parsing-xhtml-documents:xml-scripting-support-enabled-2>XML scripting support enabled</a>
creates a <code id=parsing-xhtml-documents:the-script-element><a href=#the-script-element>script</a></code> element, it
must be marked as being <a href=#parser-inserted id=parsing-xhtml-documents:parser-inserted>"parser-inserted"</a> and its <a href=#force-async id=parsing-xhtml-documents:force-async>"force-async"</a> flag
must be unset. If the parser was originally created for the <a href=#xml-fragment-parsing-algorithm id=parsing-xhtml-documents:xml-fragment-parsing-algorithm>XML fragment parsing
algorithm</a>, then the element must be marked as <a href=#already-started id=parsing-xhtml-documents:already-started>"already started"</a> also. When the
element's end tag is parsed, the user agent must <a href=#perform-a-microtask-checkpoint id=parsing-xhtml-documents:perform-a-microtask-checkpoint>perform a microtask checkpoint</a>, and
element's end tag is subsequently parsed, the user agent must <a href=#perform-a-microtask-checkpoint id=parsing-xhtml-documents:perform-a-microtask-checkpoint>perform a microtask checkpoint</a>, and
then <a href=#prepare-a-script id=parsing-xhtml-documents:prepare-a-script>prepare</a> the <code id=parsing-xhtml-documents:the-script-element-2><a href=#the-script-element>script</a></code> element. If this
causes there to be a <a href=#pending-parsing-blocking-script id=parsing-xhtml-documents:pending-parsing-blocking-script>pending parsing-blocking script</a>, then the user agent must run
the following steps:</p>
Expand All @@ -76710,24 +76714,27 @@ document.body.appendChild(text);
available for <a href=#xml-documents id=parsing-xhtml-documents:xml-documents>XML documents</a>, much of the complexity in the <a href=#html-parser id=parsing-xhtml-documents:html-parser>HTML parser</a>
is not needed in the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-6>XML parser</a>.</p>

<p id=templateTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-7>XML parser</a> would append a node to a
<p class=note>When the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-7>XML parser</a> has <a href=#xml-scripting-support-disabled id=parsing-xhtml-documents:xml-scripting-support-disabled>XML scripting support disabled</a>,
none of this happens.</p>

<p id=templateTagXML>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-8>XML parser</a> would append a node to a
<code id=parsing-xhtml-documents:the-template-element><a href=#the-template-element>template</a></code> element, it must instead append it to the <code id=parsing-xhtml-documents:the-template-element-2><a href=#the-template-element>template</a></code> element's
<a href=#template-contents id=parsing-xhtml-documents:template-contents>template contents</a> (a <code id=parsing-xhtml-documents:documentfragment><a href=#documentfragment>DocumentFragment</a></code> node).</p>

<p class=note>This is a <a href=#willful-violation id=parsing-xhtml-documents:willful-violation-2>willful violation</a> of the XML specification; unfortunately,
XML is not formally extensible in the manner that is needed for <code id=parsing-xhtml-documents:the-template-element-3><a href=#the-template-element>template</a></code> processing.
<a href=#refsXML>[XML]</a></p>

<p>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-8>XML parser</a> creates a <code id=parsing-xhtml-documents:node><a href=#node>Node</a></code> object, its <code id=parsing-xhtml-documents:dom-node-ownerdocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> must be set to the <code id=parsing-xhtml-documents:document-6><a href=#document>Document</a></code> of
<p>When an <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-9>XML parser</a> creates a <code id=parsing-xhtml-documents:node><a href=#node>Node</a></code> object, its <code id=parsing-xhtml-documents:dom-node-ownerdocument><a href=#dom-node-ownerdocument>ownerDocument</a></code> must be set to the <code id=parsing-xhtml-documents:document-6><a href=#document>Document</a></code> of
the node into which the newly created node is to be inserted.</p>

<p>Certain algorithms in this specification <dfn id=feed-the-parser>spoon-feed the
parser</dfn> characters one string at a time. In such cases, the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-9>XML parser</a> must act
parser</dfn> characters one string at a time. In such cases, the <a href=#xml-parser id=parsing-xhtml-documents:xml-parser-10>XML parser</a> must act
as it would have if faced with a single string consisting of the concatenation of all those
characters.</p>

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

Expand Down
14 changes: 11 additions & 3 deletions source
Expand Up @@ -104914,7 +104914,7 @@ document.body.appendChild(text);
parsed or the parser detects a well-formedness error, the user agent must act as if the element
was in a <span>stack of open elements</span>.</p>

<p class="note">This is used by the <code>object</code> element to avoid instantiating plugins
<p class="note">This is used, e.g. by the <code>object</code> element to avoid instantiating plugins
before the <code>param</code> element children have been parsed.</p>

<p>This specification provides the following additional information that user agents should use
Expand Down Expand Up @@ -104944,11 +104944,16 @@ document.body.appendChild(text);
motivated by a desire for user agents to all handle entities in an interoperable fashion without
requiring any network access for handling external subsets. <ref spec=XML></p>

<p id="scriptTagXML">When an <span>XML parser</span> creates a <code>script</code> element, it
<p>XML parsers can be invoked with <dfn>XML scripting support enabled</dfn> or <dfn data-x="XML
scripting support disabled">disabled</dfn>. Except where otherwise specified, XML parsers are
invoked with <span>XML scripting support enabled</span>.</p>

<p id="scriptTagXML">When an <span>XML parser</span> with <span>XML scripting support enabled</span>
creates a <code>script</code> element, it
must be marked as being <span>"parser-inserted"</span> and its <span>"force-async"</span> flag
must be unset. If the parser was originally created for the <span>XML fragment parsing
algorithm</span>, then the element must be marked as <span>"already started"</span> also. When the
element's end tag is parsed, the user agent must <span>perform a microtask checkpoint</span>, and
element's end tag is subsequently parsed, the user agent must <span>perform a microtask checkpoint</span>, and
then <span data-x="prepare a script">prepare</span> the <code>script</code> element. If this
causes there to be a <span>pending parsing-blocking script</span>, then the user agent must run
the following steps:</p>
Expand Down Expand Up @@ -104976,6 +104981,9 @@ document.body.appendChild(text);
available for <span>XML documents</span>, much of the complexity in the <span>HTML parser</span>
is not needed in the <span>XML parser</span>.</p>

<p class="note">When the <span>XML parser</span> has <span>XML scripting support disabled</span>,
none of this happens.</p>

<p id="templateTagXML">When an <span>XML parser</span> would append a node to a
<code>template</code> element, it must instead append it to the <code>template</code> element's
<span>template contents</span> (a <code>DocumentFragment</code> node).</p>
Expand Down

0 comments on commit c1f5393

Please sign in to comment.