|
/** |
|
* Async and defer simply do not work on inline scripts. It won’t do any harm, |
|
* but it’s useful to know about. |
|
*/ |
|
head script:not([src])[async], |
|
head script:not([src])[defer] { |
|
border-style: var(--ct-is-problematic); |
|
border-color: var(--ct-warn); |
|
} |
|
|
|
head script:not([src])[async]::before { |
|
content: "The async attribute is redundant on inline scripts" |
|
} |
|
|
|
head script:not([src])[defer]::before { |
|
content: "The defer attribute is redundant on inline scripts" |
|
} |
Async and defer simply do not work on inline scripts. It won’t do any harm, but it’s useful to know about.
This is true for classic scripts, but type=module inline scripts can usefully have async applied:
<script type=module>
// I run like `defer`!
</script>
<script type=module async>
// I run as soon as encountered but non-blocking!
</script>
defer is still useless, as it is redundant.
ct/ct.css
Lines 187 to 203 in 1f0a063
This is true for classic scripts, but
type=moduleinline scripts can usefully haveasyncapplied:deferis still useless, as it is redundant.