Skip to content

Commit

Permalink
Use "child text content" to check if a <script> is empty
Browse files Browse the repository at this point in the history
This matches 2/4 implementations, and is simpler and integrates better
with the rest of the algorithm.

Closes #3419.
  • Loading branch information
domenic committed Feb 12, 2018
1 parent 2cca8f6 commit 1d64c41
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -57723,11 +57723,12 @@ o............A....e

</li>

<li><p>Let <var>source text</var> be the element's <span>child text content</span>.</p></li>

<li id="script-processing-empty">

<p>If the element has no <code data-x="attr-script-src">src</code> attribute, and its child
nodes, if any, consist only of comment nodes and empty <code>Text</code> nodes, then return. The
script is not executed.</p>
<p>If the element has no <code data-x="attr-script-src">src</code> attribute, and <var>source
text</var> is the empty string, then return. The script is not executed.</p>

</li>

Expand Down Expand Up @@ -57845,8 +57846,8 @@ o............A....e
data-x="attr-script-src">src</code> content attribute, and the <span>Should element's inline
behavior be blocked by Content Security Policy?</span> algorithm returns "<code
data-x="">Blocked</code>" when executed upon the <code>script</code> element, "<code
data-x="">script</code>", and the <code>script</code> element's <span>child text content</span>,
then return. The script is not executed. <ref spec="CSP"></p></li>
data-x="">script</code>", and <var>source text</var>, then return. The script is not executed.
<ref spec="CSP"></p></li>

<li id="script-processing-for">

Expand Down Expand Up @@ -58006,9 +58007,6 @@ o............A....e
run these substeps:</p>

<ol>
<li><p>Let <var>source text</var> be the <code>script</code> element's <span>child text
content</span>.</p></li>

<li><p>Let <var>base URL</var> be the <code>script</code> element's <span>node
document</span>'s <span>document base URL</span>.</p></li>

Expand Down

0 comments on commit 1d64c41

Please sign in to comment.