Skip to content

Commit

Permalink
[e] (0) Make this <noscript> content model algorithm mildly simpler
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25560
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@8603 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 5, 2014
1 parent 7978bc1 commit 253cb4c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 68 deletions.
32 changes: 9 additions & 23 deletions complete.html
Expand Up @@ -290,7 +290,7 @@
</script><body onload=init()>
<header class="head with-buttons" id=head><p><a href=//www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 3 May 2014</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 5 May 2014</h2>
</hgroup><div>
<div>
<a href=//whatwg.org/html><span><strong>Multipage Version</strong> <code>whatwg.org/html</code></span></a>
Expand Down Expand Up @@ -54068,38 +54068,24 @@ <h4 id=the-noscript-element><span class=secno>4.12.2 </span>The <dfn><code>noscr

<dd>

<!--CLEANUP-->
<p>The <code><a href=#the-noscript-element>noscript</a></code> element must contain only text, except that the text must be such
that running the following algorithm results in a conforming document with no
<code><a href=#the-noscript-element>noscript</a></code> elements and no <code><a href=#the-script-element>script</a></code> elements, and such that no step in the
algorithm causes an <a href=#html-parser>HTML parser</a> to flag a <a href=#parse-error>parse error</a>:</p>

algorithm throws an exception or causes an <a href=#html-parser>HTML parser</a> to flag a <a href=#parse-error>parse error</a>:</p>
<!-- the possible exception is from the outerHTML setter -->

<ol><li>Remove every <code><a href=#the-script-element>script</a></code> element from the document.</li>

<li>Make a list of every <code><a href=#the-noscript-element>noscript</a></code> element in the document. For every
<code><a href=#the-noscript-element>noscript</a></code> element in that list, perform the following steps:

<ol><li>Let the <var title="">parent element</var> be the parent element of the
<code><a href=#the-noscript-element>noscript</a></code> element.</li>

<li>Take all the children of the <var title="">parent element</var> that come before the
<code><a href=#the-noscript-element>noscript</a></code> element, and call these elements <var title="">the before
children</var>.</li>

<li>Take all the children of the <var title="">parent element</var> that come <em>after</em>
the <code><a href=#the-noscript-element>noscript</a></code> element, and call these elements <var title="">the after
children</var>.</li>

<li>Let <var title="">s</var> be the concatenation of all the <code><a href=#text>Text</a></code> node children
<ol><li>Let <var title="">s</var> be the concatenation of all the <code><a href=#text>Text</a></code> node children
of the <code><a href=#the-noscript-element>noscript</a></code> element.</li>

<li>Set the <code title=dom-innerHTML><a href=#dom-innerhtml>innerHTML</a></code> attribute of the <var title="">parent element</var> to the value of <var title="">s</var>. (This, as a side-effect,
causes the <code><a href=#the-noscript-element>noscript</a></code> element to be removed from the document.)</li>

<li>Insert <var title="">the before children</var> at the start of the <var title="">parent
element</var>, preserving their original relative order.</li>

<li>Insert <var title="">the after children</var> at the end of the <var title="">parent
element</var>, preserving their original relative order.</li>
<li>Set the <code title=dom-outerHTML><a href=#dom-outerhtml>outerHTML</a></code> attribute of the
<code><a href=#the-noscript-element>noscript</a></code> element to the value of <var title="">s</var>. (This, as a
side-effect, causes the <code><a href=#the-noscript-element>noscript</a></code> element to be removed from the document.) <a href=#refsDOMPARSING>[DOMPARSING]</a></li>

</ol></li>

Expand Down
32 changes: 9 additions & 23 deletions index
Expand Up @@ -290,7 +290,7 @@
</script><body onload=init()>
<header class="head with-buttons" id=head><p><a href=//www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 3 May 2014</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 5 May 2014</h2>
</hgroup><div>
<div>
<a href=//whatwg.org/html><span><strong>Multipage Version</strong> <code>whatwg.org/html</code></span></a>
Expand Down Expand Up @@ -54068,38 +54068,24 @@ not-slash = %x0000-002E / %x0030-10FFFF

<dd>

<!--CLEANUP-->
<p>The <code><a href=#the-noscript-element>noscript</a></code> element must contain only text, except that the text must be such
that running the following algorithm results in a conforming document with no
<code><a href=#the-noscript-element>noscript</a></code> elements and no <code><a href=#the-script-element>script</a></code> elements, and such that no step in the
algorithm causes an <a href=#html-parser>HTML parser</a> to flag a <a href=#parse-error>parse error</a>:</p>

algorithm throws an exception or causes an <a href=#html-parser>HTML parser</a> to flag a <a href=#parse-error>parse error</a>:</p>
<!-- the possible exception is from the outerHTML setter -->

<ol><li>Remove every <code><a href=#the-script-element>script</a></code> element from the document.</li>

<li>Make a list of every <code><a href=#the-noscript-element>noscript</a></code> element in the document. For every
<code><a href=#the-noscript-element>noscript</a></code> element in that list, perform the following steps:

<ol><li>Let the <var title="">parent element</var> be the parent element of the
<code><a href=#the-noscript-element>noscript</a></code> element.</li>

<li>Take all the children of the <var title="">parent element</var> that come before the
<code><a href=#the-noscript-element>noscript</a></code> element, and call these elements <var title="">the before
children</var>.</li>

<li>Take all the children of the <var title="">parent element</var> that come <em>after</em>
the <code><a href=#the-noscript-element>noscript</a></code> element, and call these elements <var title="">the after
children</var>.</li>

<li>Let <var title="">s</var> be the concatenation of all the <code><a href=#text>Text</a></code> node children
<ol><li>Let <var title="">s</var> be the concatenation of all the <code><a href=#text>Text</a></code> node children
of the <code><a href=#the-noscript-element>noscript</a></code> element.</li>

<li>Set the <code title=dom-innerHTML><a href=#dom-innerhtml>innerHTML</a></code> attribute of the <var title="">parent element</var> to the value of <var title="">s</var>. (This, as a side-effect,
causes the <code><a href=#the-noscript-element>noscript</a></code> element to be removed from the document.)</li>

<li>Insert <var title="">the before children</var> at the start of the <var title="">parent
element</var>, preserving their original relative order.</li>

<li>Insert <var title="">the after children</var> at the end of the <var title="">parent
element</var>, preserving their original relative order.</li>
<li>Set the <code title=dom-outerHTML><a href=#dom-outerhtml>outerHTML</a></code> attribute of the
<code><a href=#the-noscript-element>noscript</a></code> element to the value of <var title="">s</var>. (This, as a
side-effect, causes the <code><a href=#the-noscript-element>noscript</a></code> element to be removed from the document.) <a href=#refsDOMPARSING>[DOMPARSING]</a></li>

</ol></li>

Expand Down
30 changes: 8 additions & 22 deletions source
Expand Up @@ -59872,11 +59872,13 @@ not-slash = %x0000-002E / %x0030-10FFFF

<dd>

<!--CLEANUP-->
<p>The <code>noscript</code> element must contain only text, except that the text must be such
that running the following algorithm results in a conforming document with no
<code>noscript</code> elements and no <code>script</code> elements, and such that no step in the
algorithm causes an <span>HTML parser</span> to flag a <span>parse error</span>:</p>

algorithm throws an exception or causes an <span>HTML parser</span> to flag a <span>parse error</span>:</p>
<!-- the possible exception is from the outerHTML setter -->

<ol>

<li>Remove every <code>script</code> element from the document.</li>
Expand All @@ -59886,29 +59888,13 @@ not-slash = %x0000-002E / %x0030-10FFFF

<ol>

<li>Let the <var data-x="">parent element</var> be the parent element of the
<code>noscript</code> element.</li>

<li>Take all the children of the <var data-x="">parent element</var> that come before the
<code>noscript</code> element, and call these elements <var data-x="">the before
children</var>.</li>

<li>Take all the children of the <var data-x="">parent element</var> that come <em>after</em>
the <code>noscript</code> element, and call these elements <var data-x="">the after
children</var>.</li>

<li>Let <var data-x="">s</var> be the concatenation of all the <code>Text</code> node children
of the <code>noscript</code> element.</li>

<li>Set the <code data-x="dom-innerHTML">innerHTML</code> attribute of the <var
data-x="">parent element</var> to the value of <var data-x="">s</var>. (This, as a side-effect,
causes the <code>noscript</code> element to be removed from the document.)</li>

<li>Insert <var data-x="">the before children</var> at the start of the <var data-x="">parent
element</var>, preserving their original relative order.</li>

<li>Insert <var data-x="">the after children</var> at the end of the <var data-x="">parent
element</var>, preserving their original relative order.</li>
<li>Set the <code data-x="dom-outerHTML">outerHTML</code> attribute of the
<code>noscript</code> element to the value of <var data-x="">s</var>. (This, as a
side-effect, causes the <code>noscript</code> element to be removed from the document.) <a
href="#refsDOMPARSING">[DOMPARSING]</a></li>

</ol>

Expand Down

0 comments on commit 253cb4c

Please sign in to comment.