From 42699b29afd56a66d391431b0229a74dfe0ef47c Mon Sep 17 00:00:00 2001 From: arthursonzogni Date: Fri, 28 Feb 2020 08:09:03 -0800 Subject: [PATCH] [CSP] Factorize SVGElement & MHTMLElement nonce hiding. According to: https://github.com/whatwg/html/pull/2373 html and svg Element are hiding their nonce when there are at least one Content-Security-Policy defined from an HTTP header. The two implementation: - HTMLElement::InsertedInto - SVGElement::InsertedInto were hidding the nonce slightly differently. To prevent further divergence, factorize this implementation into Element::HideNonce() and call it from both places. Bug: 1053496 Change-Id: I3cbad88f70c61591bef060d4188c82388e6001d2 --- .../nonce-hiding/nonces.html | 84 +++++++++++++------ 1 file changed, 58 insertions(+), 26 deletions(-) diff --git a/content-security-policy/nonce-hiding/nonces.html b/content-security-policy/nonce-hiding/nonces.html index b023d060323d9d..7ee10a7b29e5a5 100644 --- a/content-security-policy/nonce-hiding/nonces.html +++ b/content-security-policy/nonce-hiding/nonces.html @@ -3,30 +3,62 @@