Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: third_party/WebKit/Source/core/svg/SVGScriptElement.cpp

Issue 2801243002: More tweaks to <script nonce> hiding. (Closed)
Patch Set: Moved tests. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGScriptElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp b/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
index 679b4c016a48f57c6441113d9097341f837c6df1..946c8818bcee8fd16a66af243567b6995c7d23fe 100644
--- a/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
@@ -51,14 +51,6 @@ void SVGScriptElement::ParseAttribute(
EventTypeNames::error,
CreateAttributeEventListener(this, params.name, params.new_value,
EventParameterName()));
- } else if (params.name == HTMLNames::nonceAttr) {
- if (params.new_value == ContentSecurityPolicy::GetNonceReplacementString())
- return;
- setNonce(params.new_value);
- if (RuntimeEnabledFeatures::hideNonceContentAttributeEnabled()) {
- setAttribute(HTMLNames::nonceAttr,
- ContentSecurityPolicy::GetNonceReplacementString());
- }
} else {
SVGElement::ParseAttribute(params);
}
@@ -138,8 +130,9 @@ bool SVGScriptElement::HasChildren() const {
return Node::hasChildren();
}
-bool SVGScriptElement::IsNonceableElement() const {
- return ContentSecurityPolicy::IsNonceableElement(this);
+const AtomicString& SVGScriptElement::GetNonceForElement() const {
+ return ContentSecurityPolicy::IsNonceableElement(this) ? nonce()
+ : g_null_atom;
}
bool SVGScriptElement::AllowInlineScriptForCSP(
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGScriptElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698