-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browsers don't allow whitespaces in <script type="module"> type attribute #7018
Comments
hiroshige-g
changed the title
<script type="module"> doesn't allow whitespaces in type attribute value
Browsers doesn't allow whitespaces in <script type="module"> type attribute
Sep 3, 2021
hiroshige-g
changed the title
Browsers doesn't allow whitespaces in <script type="module"> type attribute
Browsers don't allow whitespaces in <script type="module"> type attribute
Sep 3, 2021
Happy to change the spec here! I guess we should move the stripping from its current location in determining "the script block's type string", to the comparison step which checks "JavaScript MIME type essence match". And we should update the note that was just introduced for Would you like to submit a pull request for this? |
3 tasks
Created a PR. |
annevk
pushed a commit
that referenced
this issue
Sep 7, 2021
mfreed7
pushed a commit
to mfreed7/html
that referenced
this issue
Jun 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the spec,
<script type=" module ">
should be executed, becauseleading and trailing ASCII whitespace stripped
is applied to the type attribute value before comparing with"module"
.However, Safari/Firefox/Chromium all reject such cases (WPT: https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/module/type.html?label=experimental&label=master&aligned. the test expects module types with whitespaces NOT to be executed).
(Note: for classic scripts leading/trailing whitespaces are allowed on the all browsers above:
https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/script-type-and-language-js.html?label=experimental&label=master&aligned)
Maybe we might want to change the spec, or fix impls?
(I found this during bug triaging and thus the priority is quite low anyway)
@domenic
The text was updated successfully, but these errors were encountered: