Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
index 2b19ef87843d7094d9609e67a09d1dd809adbd41..fd07ec9e3f735f7a11dc0cfcfb1451f28301931e 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp |
@@ -25,6 +25,7 @@ |
#include "bindings/core/v8/ScriptController.h" |
#include "bindings/core/v8/ScriptSourceCode.h" |
+#include "bindings/core/v8/UnionTypesCore.h" |
#include "core/HTMLNames.h" |
#include "core/SVGNames.h" |
#include "core/dom/Document.h" |
@@ -426,14 +427,16 @@ bool ScriptLoader::executeScript(const ScriptSourceCode& sourceCode, double* com |
IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrementer(m_isExternalScript || isImportedScript ? contextDocument : 0); |
if (isHTMLScriptLoader(m_element)) |
- contextDocument->pushCurrentScript(toHTMLScriptElement(m_element)); |
+ contextDocument->pushCurrentScript(HTMLScriptElementOrSVGScriptElement::fromHTMLScriptElement(toHTMLScriptElement(m_element))); |
+ else if (isSVGScriptLoader(m_element)) |
+ contextDocument->pushCurrentScript(HTMLScriptElementOrSVGScriptElement::fromSVGScriptElement(toSVGScriptElement(m_element))); |
// Create a script from the script element node, using the script |
// block's source and the script block's type. |
// Note: This is where the script is compiled and actually executed. |
frame->script().executeScriptInMainWorld(sourceCode, accessControlStatus, compilationFinishTime); |
- if (isHTMLScriptLoader(m_element)) { |
+ if (isHTMLScriptLoader(m_element) || isSVGScriptLoader(m_element)) { |
DCHECK(contextDocument->currentScript() == m_element); |
contextDocument->popCurrentScript(); |
} |