Skip to content

Do not strip whitespace from non-classic script types - #13031

Open
annevk wants to merge 1 commit into
mainfrom
annevk/script-type-whitespace
Open

annevk wants to merge 1 commit into
mainfrom
annevk/script-type-whitespace

Conversation

@annevk

@annevk annevk commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

As in WebKit and Chromium, only strip leading and trailing ASCII whitespace from the type attribute value for the JavaScript MIME type check, so that, e.g., type=" module " is not a module script.

Fixes #13012. This is a follow-up to 36470c1.

(See WHATWG Working Mode: Changes for more details.)


/scripting.html ( diff )

As in WebKit and Chromium, only strip leading and trailing ASCII whitespace from the type attribute value for the JavaScript MIME type check, so that, e.g., type=" module " is not a module script.

Fixes #13012. This is a follow-up to 36470c1.
@annevk
annevk requested review from emilio and zcorpan October 3, 2026 11:06

@emilio emilio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me, can you file a Gecko bug to change this?

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Is whitespace around type="module" stripped?

2 participants