Skip to content

Commit 1d64c41

Browse files
committed
Use "child text content" to check if a <script> is empty
This matches 2/4 implementations, and is simpler and integrates better with the rest of the algorithm. Closes #3419.
1 parent 2cca8f6 commit 1d64c41

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

source

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57723,11 +57723,12 @@ o............A....e
5772357723

5772457724
</li>
5772557725

57726+
<li><p>Let <var>source text</var> be the element's <span>child text content</span>.</p></li>
57727+
5772657728
<li id="script-processing-empty">
5772757729

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

5773257733
</li>
5773357734

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

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

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

5800858009
<ol>
58009-
<li><p>Let <var>source text</var> be the <code>script</code> element's <span>child text
58010-
content</span>.</p></li>
58011-
5801258010
<li><p>Let <var>base URL</var> be the <code>script</code> element's <span>node
5801358011
document</span>'s <span>document base URL</span>.</p></li>
5801458012

0 commit comments

Comments
 (0)