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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptElementBase.cpp

Issue 2723793002: De-Element ScriptLoader (Closed)
Patch Set: ScriptLoaderClient->ScriptElementBase, pure virtual interface, add fixme Created 3 years, 9 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/dom/ScriptElementBase.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptElementBase.cpp b/third_party/WebKit/Source/core/dom/ScriptElementBase.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9ccf2d31d19d64cebaa0803002289a6abc142453
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/ScriptElementBase.cpp
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/dom/ScriptElementBase.h"
+
+#include "core/html/HTMLScriptElement.h"
+#include "core/svg/SVGScriptElement.h"
+
+namespace blink {
+
+ScriptElementBase* ScriptElementBase::fromElementIfPossible(Element* element) {
+ if (isHTMLScriptElement(*element))
+ return toHTMLScriptElement(element);
+ if (isSVGScriptElement(*element))
+ return toSVGScriptElement(element);
+ return nullptr;
+}
+
+void ScriptElementBase::initializeScriptLoader(
+ bool parserInserted,
+ bool alreadyStarted,
+ bool createdDuringDocumentWrite) {
+ m_loader = ScriptLoader::create(this, parserInserted, alreadyStarted,
+ createdDuringDocumentWrite);
+}
+
+DEFINE_TRACE(ScriptElementBase) {
+ visitor->trace(m_loader);
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptElementBase.h ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698