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

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

Issue 1814853003: Track whether an element was inserted via document.write (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on #384935 Created 4 years, 8 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 d80afb1f010b5144c3c258d3911815ac95e267e6..ee874809c3875762bd038ff1a16bc41d75edc53a 100644
--- a/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp
@@ -23,22 +23,21 @@
#include "bindings/core/v8/ScriptEventListener.h"
#include "core/HTMLNames.h"
#include "core/dom/Attribute.h"
-#include "core/dom/ScriptLoader.h"
#include "core/dom/ScriptRunner.h"
#include "core/events/Event.h"
namespace blink {
-inline SVGScriptElement::SVGScriptElement(Document& document, bool wasInsertedByParser, bool alreadyStarted)
+inline SVGScriptElement::SVGScriptElement(Document& document, int constructionContextFlags)
: SVGElement(SVGNames::scriptTag, document)
, SVGURIReference(this)
- , m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted))
+ , m_loader(ScriptLoader::create(this, constructionContextFlags))
{
}
-SVGScriptElement* SVGScriptElement::create(Document& document, bool insertedByParser)
+SVGScriptElement* SVGScriptElement::create(Document& document, int constructionContextFlags)
{
- return new SVGScriptElement(document, insertedByParser, false);
+ return new SVGScriptElement(document, constructionContextFlags);
}
void SVGScriptElement::parseAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& value)
@@ -149,7 +148,8 @@ bool SVGScriptElement::hasSourceAttribute() const
RawPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren()
{
- return new SVGScriptElement(document(), false, m_loader->alreadyStarted());
+ int constructionContextFlags = m_loader->alreadyStarted() ? AlreadyStarted : DefaultContext;
+ return new SVGScriptElement(document(), constructionContextFlags);
}
void SVGScriptElement::dispatchLoadEvent()

Powered by Google App Engine
This is Rietveld 408576698