Chromium Code Reviews| 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..1afd99cfed59842cc3bf8ad62315496de84f1a9f 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,14 +4583,19 @@ 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); |
| m_currentScriptStack.append(newCurrentScript); |
|
fs
2016/05/04 08:42:54
Add a DCHECK here that |newCurrentScript| is one o
ramya.v
2016/05/04 09:35:51
Done.
|