mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00:00
[DOM] Add missing IDL definitions for CSP .nonce attributes.
Apparently Mozilla completely spaced out on this when adding the CSP nonce mechanism, potentially causing web compat issues if scripting relies on being able to get/set nonces through DOM and/or causing CSP policy check issues if websites try to "hide" nonces.
This commit is contained in:
@@ -109,6 +109,14 @@ public:
|
||||
SetHTMLAttr(nsGkAtoms::rel, aRel, aRv);
|
||||
}
|
||||
nsDOMTokenList* RelList();
|
||||
void GetNonce(nsAString& aNonce) const
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::nonce, aNonce);
|
||||
}
|
||||
void SetNonce(const nsAString& aNonce, ErrorResult& aRv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::nonce, aNonce, aRv);
|
||||
}
|
||||
// XPCOM GetMedia is fine.
|
||||
void SetMedia(const nsAString& aMedia, ErrorResult& aRv)
|
||||
{
|
||||
|
||||
@@ -80,6 +80,14 @@ public:
|
||||
{
|
||||
SetOrRemoveNullableStringAttr(nsGkAtoms::crossorigin, aCrossOrigin, aError);
|
||||
}
|
||||
void GetNonce(nsAString& aNonce) const
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::nonce, aNonce);
|
||||
}
|
||||
void SetNonce(const nsAString& aNonce, ErrorResult& aRv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::nonce, aNonce, aRv);
|
||||
}
|
||||
void GetIntegrity(nsAString& aIntegrity)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::integrity, aIntegrity);
|
||||
|
||||
@@ -60,6 +60,14 @@ public:
|
||||
|
||||
bool Disabled() const;
|
||||
void SetDisabled(bool aDisabled);
|
||||
void GetNonce(nsAString& aNonce) const
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::nonce, aNonce);
|
||||
}
|
||||
void SetNonce(const nsAString& aNonce, ErrorResult& aRv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::nonce, aNonce, aRv);
|
||||
}
|
||||
void SetMedia(const nsAString& aMedia, ErrorResult& aError)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::media, aMedia, aError);
|
||||
|
||||
@@ -26,6 +26,8 @@ interface HTMLLinkElement : HTMLElement {
|
||||
readonly attribute DOMTokenList relList;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString media;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString nonce;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString hreflang;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
|
||||
@@ -26,6 +26,10 @@ interface HTMLScriptElement : HTMLElement {
|
||||
attribute DOMString? crossOrigin;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString text;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString nonce;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString integrity;
|
||||
};
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
|
||||
@@ -35,9 +39,3 @@ partial interface HTMLScriptElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString htmlFor;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/webappsec/specs/subresourceintegrity/#htmlscriptelement-1
|
||||
partial interface HTMLScriptElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString integrity;
|
||||
};
|
||||
|
||||
@@ -15,6 +15,8 @@ interface HTMLStyleElement : HTMLElement {
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString media;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString nonce;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute DOMString type;
|
||||
[SetterThrows, Pure]
|
||||
attribute boolean scoped;
|
||||
|
||||
Reference in New Issue
Block a user