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

Unified Diff: third_party/WebKit/Source/core/html/HTMLScriptElement.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/html/HTMLScriptElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp b/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp
index d61560f575c8c30e73eae448b428f780c16befe9..6db55e8ae10a936be4fd628ce1c63bb011f8017c 100644
--- a/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp
@@ -37,15 +37,15 @@ namespace blink {
using namespace HTMLNames;
-inline HTMLScriptElement::HTMLScriptElement(Document& document, bool wasInsertedByParser, bool alreadyStarted)
+inline HTMLScriptElement::HTMLScriptElement(Document& document, int constructionContextFlags)
: HTMLElement(scriptTag, document)
- , m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted))
+ , m_loader(ScriptLoader::create(this, constructionContextFlags))
{
}
-RawPtr<HTMLScriptElement> HTMLScriptElement::create(Document& document, bool wasInsertedByParser, bool alreadyStarted)
+RawPtr<HTMLScriptElement> HTMLScriptElement::create(Document& document, int constructionContextFlags)
{
- return new HTMLScriptElement(document, wasInsertedByParser, alreadyStarted);
+ return new HTMLScriptElement(document, constructionContextFlags);
}
bool HTMLScriptElement::isURLAttribute(const Attribute& attribute) const
@@ -176,7 +176,8 @@ void HTMLScriptElement::dispatchLoadEvent()
RawPtr<Element> HTMLScriptElement::cloneElementWithoutAttributesAndChildren()
{
- return new HTMLScriptElement(document(), false, m_loader->alreadyStarted());
+ int constructionContextFlags = m_loader->alreadyStarted() ? AlreadyStarted : DefaultContext;
+ return new HTMLScriptElement(document(), constructionContextFlags);
}
DEFINE_TRACE(HTMLScriptElement)

Powered by Google App Engine
This is Rietveld 408576698