Index: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp |
diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp |
index 800abaeba2f1045c1f6ff6d4db4f6a2cd8dfe1fc..5303175be3582ffcf50d9c5206a57583079adcd3 100644 |
--- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp |
+++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp |
@@ -448,7 +448,8 @@ void XMLDocumentParser::notifyFinished(Resource* unusedResource) { |
Element* e = m_scriptElement; |
m_scriptElement = nullptr; |
- ScriptLoader* scriptLoader = toScriptLoaderIfPossible(e); |
+ ScriptLoader* scriptLoader = |
+ ScriptLoaderClient::fromElementIfPossible(e)->loader(); |
DCHECK(scriptLoader); |
if (errorOccurred) { |
@@ -1029,8 +1030,7 @@ void XMLDocumentParser::startElementNs(const AtomicString& localName, |
newElement->beginParsingChildren(); |
- ScriptLoader* scriptLoader = toScriptLoaderIfPossible(newElement); |
- if (scriptLoader) |
+ if (ScriptLoaderClient::fromElementIfPossible(newElement)) |
hiroshige
2017/03/01 00:58:15
Same as HTMLOptionElement.cpp.
Nate Chapin
2017/03/01 21:35:00
Done.
|
m_scriptStartPosition = textPosition(); |
m_currentNode->parserAppendChild(newElement); |
@@ -1075,8 +1075,12 @@ void XMLDocumentParser::endElementNs() { |
if (m_currentNode->isElementNode()) |
toElement(n)->finishParsingChildren(); |
+ ScriptLoaderClient* scriptLoaderClient = |
+ n->isElementNode() |
+ ? ScriptLoaderClient::fromElementIfPossible(toElement(n)) |
+ : nullptr; |
if (!scriptingContentIsAllowed(getParserContentPolicy()) && |
- n->isElementNode() && toScriptLoaderIfPossible(toElement(n))) { |
+ scriptLoaderClient) { |
popCurrentNode(); |
n->remove(IGNORE_EXCEPTION_FOR_TESTING); |
return; |
@@ -1096,7 +1100,8 @@ void XMLDocumentParser::endElementNs() { |
return; |
} |
- ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); |
+ ScriptLoader* scriptLoader = |
+ scriptLoaderClient ? scriptLoaderClient->loader() : nullptr; |
if (!scriptLoader) { |
popCurrentNode(); |
return; |