Skip to content
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

<script>'s language attribute is not whitespace-stripped in actual implementations #7923

Closed
hiroshige-g opened this issue May 13, 2022 · 5 comments · Fixed by #8084
Closed

Comments

@hiroshige-g
Copy link
Contributor

A minor issue:

In the current spec, script language attributes with valid value + trailing whitespaces would be executed, e.g.

but this whitespace stripping is not performed on Safari/Firefox/Chrome, according to https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/script-type-and-language-js.html.

I think it's better to modify the spec to align with the implementations, like:

@annevk
Copy link
Member

annevk commented May 13, 2022

Nice find! Willing to create a PR for this?

@Yay295
Copy link
Contributor

Yay295 commented May 13, 2022

I'm not following those tests. It shows both of these passing for all four browsers:
Script should run with type="text/javascript "
Script shouldn't run with language="javascript "

But according to the steps you listed these should both have a type string of "text/javascript" and be valid.

@hiroshige-g
Copy link
Contributor Author

Sure, I'll create a PR later when I have time.

@Yay295 Right, the WPT's expectation doesn't match with the current spec, and instead matches with the proposed change here.

@hiroshige-g
Copy link
Contributor Author

Memo: I'll wait for #7876 to land before creating a PR to avoid conflicts.

@domenic
Copy link
Member

domenic commented Jun 30, 2022

@hiroshige-g ready to create a PR for this?

domenic pushed a commit that referenced this issue Jul 8, 2022
This matches implementations, which only whitespace-strip the type="" attribute.

Closes #7923.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants