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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 18 matching lines...) Expand all
29 #include "core/events/Event.h" 29 #include "core/events/Event.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 inline SVGScriptElement::SVGScriptElement(Document& document, 33 inline SVGScriptElement::SVGScriptElement(Document& document,
34 bool wasInsertedByParser, 34 bool wasInsertedByParser,
35 bool alreadyStarted) 35 bool alreadyStarted)
36 : SVGElement(SVGNames::scriptTag, document), 36 : SVGElement(SVGNames::scriptTag, document),
37 SVGURIReference(this), 37 SVGURIReference(this),
38 m_loader( 38 m_loader(
39 ScriptLoader::create(this, wasInsertedByParser, alreadyStarted)) {} 39 ScriptLoader::create(this, wasInsertedByParser, alreadyStarted)) {
40 if (fastHasAttribute(HTMLNames::nonceAttr)) {
41 m_nonce = fastGetAttribute(HTMLNames::nonceAttr);
42 if (RuntimeEnabledFeatures::hideNonceContentAttributeEnabled())
43 removeAttribute(HTMLNames::nonceAttr);
44 }
45 }
40 46
41 SVGScriptElement* SVGScriptElement::create(Document& document, 47 SVGScriptElement* SVGScriptElement::create(Document& document,
42 bool insertedByParser) { 48 bool insertedByParser) {
43 return new SVGScriptElement(document, insertedByParser, false); 49 return new SVGScriptElement(document, insertedByParser, false);
44 } 50 }
45 51
46 void SVGScriptElement::parseAttribute( 52 void SVGScriptElement::parseAttribute(
47 const AttributeModificationParams& params) { 53 const AttributeModificationParams& params) {
48 if (params.name == HTMLNames::onerrorAttr) { 54 if (params.name == HTMLNames::onerrorAttr) {
49 setAttributeEventListener( 55 setAttributeEventListener(
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 160 }
155 #endif 161 #endif
156 162
157 DEFINE_TRACE(SVGScriptElement) { 163 DEFINE_TRACE(SVGScriptElement) {
158 visitor->trace(m_loader); 164 visitor->trace(m_loader);
159 SVGElement::trace(visitor); 165 SVGElement::trace(visitor);
160 SVGURIReference::trace(visitor); 166 SVGURIReference::trace(visitor);
161 } 167 }
162 168
163 } // namespace blink 169 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698