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

Add nonce as a Content attribute for <link> #9505

Open
evilpie opened this issue Jul 10, 2023 · 4 comments
Open

Add nonce as a Content attribute for <link> #9505

evilpie opened this issue Jul 10, 2023 · 4 comments

Comments

@evilpie
Copy link

evilpie commented Jul 10, 2023

At least "The fetch and process the linked resource algorithm for modulepreload links" uses the nonce attribute implicitly via [[CryptographicNonce]].

@evilpie
Copy link
Author

evilpie commented Jul 10, 2023

Oh, maybe content attributes are those that should be exposed to JS? In that case we could close this issue.

@domenic
Copy link
Member

domenic commented Jul 12, 2023

nonce is actually a global content attribute: https://html.spec.whatwg.org/#global-attributes:attr-nonce . It's a bit strange, and maybe as an editorial matter we could move it to just script and link?

@domenic
Copy link
Member

domenic commented Jul 12, 2023

I guess it also applies to style? That doesn't seem to be specified, as far as I can tell...

This changed in #2373 but I can't find any motivation for why it became global. My best guess is that it was seen as simplest to make the magic attribute-hiding behavior universal, instead of element-specific, and then nobody thought that we could separate the attribute definition (useful for conformance, etc.) from the normative behavior?

@domenic domenic added the clarification Standard could be clearer label Jul 12, 2023
@annevk
Copy link
Member

annevk commented Aug 18, 2023

Yeah, I think it was an oversight. You want the processing model to be global in case you introduce more elements that need nonces in the future, but conformance can still be done on a per-element basis. I'd be supportive of tightening this.

cc @mikewest @arturjanc @sideshowbarker

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

No branches or pull requests

3 participants