Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp

Issue 2781713003: Enable module scripts in ScriptLoader (Closed)
Patch Set: Update TestExpectations Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f4f659d9e37a3bc7145bb52226a744aa6a37e083..8c1bb05ff59b11fe5223250e9877a69e3fb320d5 100644
--- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -452,6 +452,7 @@ void XMLDocumentParser::NotifyFinished(Resource* unused_resource) {
ScriptLoader* script_loader =
ScriptElementBase::FromElementIfPossible(e)->Loader();
DCHECK(script_loader);
+ CHECK_EQ(script_loader->GetScriptType(), ScriptType::kClassic);
if (error_occurred) {
script_loader->DispatchErrorEvent();
@@ -1112,9 +1113,16 @@ void XMLDocumentParser::EndElementNs() {
DCHECK(!pending_script_);
requesting_script_ = true;
- if (script_loader->PrepareScript(
- script_start_position_,
- ScriptLoader::kAllowLegacyTypeInTypeAttribute)) {
+ bool success = script_loader->PrepareScript(
+ script_start_position_, ScriptLoader::kAllowLegacyTypeInTypeAttribute);
+
+ if (script_loader->GetScriptType() != ScriptType::kClassic) {
+ // XMLDocumentParser does not support a module script, and thus ignores it.
+ success = false;
+ VLOG(0) << "Module scripts in XML documents are not supported.";
+ }
+
+ if (success) {
// FIXME: Script execution should be shared between
// the libxml2 and Qt XMLDocumentParser implementations.
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698