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

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

Issue 2628733005: Experiment with hiding <script>'s 'nonce' content attribute. (Closed)
Patch Set: Ugh. Created 3 years, 11 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
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 936f08e627a7bd0b5e893d6cc410fdbdb855fe9e..c0f801a411d0977f340d5889417a038bcf6e6cb0 100644
--- a/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
@@ -36,7 +36,13 @@ inline SVGScriptElement::SVGScriptElement(Document& document,
: SVGElement(SVGNames::scriptTag, document),
SVGURIReference(this),
m_loader(
- ScriptLoader::create(this, wasInsertedByParser, alreadyStarted)) {}
+ ScriptLoader::create(this, wasInsertedByParser, alreadyStarted)) {
+ if (fastHasAttribute(HTMLNames::nonceAttr)) {
+ m_nonce = fastGetAttribute(HTMLNames::nonceAttr);
+ if (RuntimeEnabledFeatures::hideNonceContentAttributeEnabled())
+ removeAttribute(HTMLNames::nonceAttr);
+ }
+}
SVGScriptElement* SVGScriptElement::create(Document& document,
bool insertedByParser) {

Powered by Google App Engine
This is Rietveld 408576698