Index: third_party/WebKit/Source/core/dom/Document.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
index b4fde8e7cfcc90578583eb715896d7731fe159c5..9055674635432851a1ddf89dbd5453b92d7e0e18 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -196,6 +196,7 @@ |
#include "core/page/scrolling/RootScroller.h" |
#include "core/page/scrolling/ScrollingCoordinator.h" |
#include "core/svg/SVGDocumentExtensions.h" |
+#include "core/svg/SVGScriptElement.h" |
#include "core/svg/SVGTitleElement.h" |
#include "core/svg/SVGUseElement.h" |
#include "core/timing/DOMWindowPerformance.h" |
@@ -4582,16 +4583,22 @@ KURL Document::openSearchDescriptionURL() |
return KURL(); |
} |
-HTMLScriptElement* Document::currentScriptForBinding() const |
+void Document::currentScriptForBinding(HTMLScriptElementOrSVGScriptElement& scriptElement) const |
{ |
- if (HTMLScriptElement* script = currentScript()) |
- return script->isInV1ShadowTree() ? nullptr : script; |
- return nullptr; |
+ if (Element* script = currentScript()) { |
+ if (script->isInV1ShadowTree()) |
+ return; |
+ if (isHTMLScriptElement(script)) |
+ scriptElement.setHTMLScriptElement(toHTMLScriptElement(script)); |
+ else if (isSVGScriptElement(script)) |
+ scriptElement.setSVGScriptElement(toSVGScriptElement(script)); |
+ } |
} |
-void Document::pushCurrentScript(HTMLScriptElement* newCurrentScript) |
+void Document::pushCurrentScript(Element* newCurrentScript) |
{ |
DCHECK(newCurrentScript); |
Srirama
2016/05/04 18:26:28
I think we can remove this DCHECK now. It is taken
ramya.v
2016/05/05 03:50:34
Removed in https://codereview.chromium.org/1943403
|
+ DCHECK(isHTMLScriptElement(newCurrentScript) || isSVGScriptElement(newCurrentScript)); |
m_currentScriptStack.append(newCurrentScript); |
} |