Skip to content

Commit 271f19c

Browse files
authored
Fix authoring guidance to allow async="" on inline module scripts
Closes #3319.
1 parent 50c65e0 commit 271f19c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

source

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57224,13 +57224,16 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {
5722457224
a <span>classic script</span>, to be interpreted according to the JavaScript <i
5722557225
data-x="js-prod-Script">Script</i> top-level production. Classic scripts are affected by the
5722657226
<code data-x="attr-script-async">async</code> and <code data-x="attr-script-defer">defer</code>
57227-
attributes. Authors should omit the attribute instead of redundantly setting it.</p></li>
57227+
attributes, but only when the <code data-x="attr-script-src">src</code> attribute is set.
57228+
Authors should omit the <code data-x="attr-script-type">type</code> attribute instead of
57229+
redundantly setting it.</p></li>
5722857230

5722957231
<li><p>Setting the attribute to an <span>ASCII case-insensitive</span> match for the string
5723057232
"<code data-x="">module</code>" means that the script is a <span>module script</span>, to be
5723157233
interpreted according to the JavaScript <i data-x="js-prod-Module">Module</i> top-level
5723257234
production. Module scripts are not affected by the <code data-x="attr-script-defer">defer</code>
57233-
attribute.</p></li>
57235+
attribute, but are affected by the <code data-x="attr-script-async">async</code> attribute
57236+
(regardless of the state of the <code data-x="attr-script-src">src</code> attribute).</p></li>
5723457237

5723557238
<li><p>Setting the attribute to any other value means that the script is a <dfn>data
5723657239
block</dfn>, which is not processed. None of the <code>script</code> attributes (except <code
@@ -57282,11 +57285,11 @@ interface <dfn>HTMLScriptElement</dfn> : <span>HTMLElement</span> {
5728257285
data-x="attr-script-defer">defer</code></dfn> attributes are <span data-x="boolean
5728357286
attribute">boolean attributes</span> that indicate how the script should be evaluated. <span
5728457287
data-x="classic script">Classic scripts</span> may specify <code
57285-
data-x="attr-script-defer">defer</code> or <code data-x="attr-script-async">async</code>; <span
57286-
data-x="module script">module scripts</span> may specify <code
57287-
data-x="attr-script-async">async</code>. The <code data-x="attr-script-defer">defer</code> and
57288-
<code data-x="attr-script-async">async</code> attributes must not be specified if the <code
57289-
data-x="attr-script-src">src</code> attribute is not present.</p>
57288+
data-x="attr-script-defer">defer</code> or <code data-x="attr-script-async">async</code>, but must
57289+
not specify either unless the <code data-x="attr-script-src">src</code> attribute is present.
57290+
<span data-x="module script">Module scripts</span> may specify the <code
57291+
data-x="attr-script-async">async</code> attribute, but must not specify the <code
57292+
data-x="attr-script-defer">defer</code> attribute.</p>
5729057293

5729157294
<p>There are several possible modes that can be selected using these attributes, and depending on
5729257295
the script's type.</p>

0 commit comments

Comments
 (0)