Commit 18acc84f authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

Use ExecuteScriptBlock() in XMLDocumentParser::EndElementNs()

Follow-up of https://chromium-review.googlesource.com/c/554098.
This shouldn't change the behavior.

Bug: 686281
Change-Id: Ia8ba4ac41aafc2851ba58389b4dd8d7d5910a226
Reviewed-on: https://chromium-review.googlesource.com/557381
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485083}
parent b356df43
......@@ -36,7 +36,7 @@
#include "core/HTMLNames.h"
#include "core/XMLNSNames.h"
#include "core/dom/CDATASection.h"
#include "core/dom/ClassicScript.h"
#include "core/dom/ClassicPendingScript.h"
#include "core/dom/Comment.h"
#include "core/dom/Document.h"
#include "core/dom/DocumentFragment.h"
......@@ -1136,18 +1136,10 @@ void XMLDocumentParser::EndElementNs() {
if (script_loader->ReadyToBeParserExecuted()) {
// 5th Clause, Step 23 of https://html.spec.whatwg.org/#prepare-a-script
switch (script_loader->ExecuteScript(ClassicScript::Create(
ScriptSourceCode(script_element_base->TextFromChildren(),
GetDocument()->Url(), script_start_position_)))) {
case ScriptLoader::ExecuteScriptResult::kShouldFireErrorEvent:
script_loader->DispatchErrorEvent();
return;
case ScriptLoader::ExecuteScriptResult::kShouldFireLoadEvent:
// The load event is not fired because this is an inline script.
break;
case ScriptLoader::ExecuteScriptResult::kShouldFireNone:
break;
}
script_loader->ExecuteScriptBlock(
ClassicPendingScript::Create(script_element_base,
script_start_position_),
GetDocument()->Url());
} else if (script_loader->WillBeParserExecuted()) {
// 1st/2nd Clauses, Step 23 of
// https://html.spec.whatwg.org/#prepare-a-script
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment