[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:
Moonchild 2021-04-19 20:47:29 +00:00 committed by roytam1
commit 7e02267fd3
6 changed files with 32 additions and 6 deletions

View file

@ -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);