| Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| index a02e2ca2086a275cb4d1cf3ef5647e11e0236ce3..cafd04a047a2320ae27dee55890cd29982081d78 100644
|
| --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| @@ -34,6 +34,7 @@
|
| #include "core/dom/ScriptLoaderClient.h"
|
| #include "core/dom/ScriptRunner.h"
|
| #include "core/dom/ScriptableDocumentParser.h"
|
| +#include "core/dom/ModuleMap.h"
|
| #include "core/dom/Text.h"
|
| #include "core/events/Event.h"
|
| #include "core/fetch/AccessControlStatus.h"
|
| @@ -260,6 +261,7 @@ bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition,
|
| if (m_documentWriteIntervention ==
|
| DocumentWriteIntervention::FetchDocWrittenScriptDeferIdle)
|
| defer = FetchRequest::IdleLoad;
|
| +
|
| if (!fetchScript(client->sourceAttributeValue(), defer))
|
| return false;
|
| }
|
| @@ -335,10 +337,17 @@ bool ScriptLoader::fetchScript(const String& sourceUrl,
|
| return false;
|
|
|
| DCHECK(!m_resource);
|
| +
|
| if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) {
|
| - FetchRequest request(
|
| - ResourceRequest(elementDocument->completeURL(sourceUrl)),
|
| - m_element->localName());
|
| + KURL url = elementDocument->completeURL(sourceUrl);
|
| +
|
| + if (RuntimeEnabledFeatures::moduleScriptsEnabled() &&
|
| + client()->typeAttributeValue() == "module") {
|
| + elementDocument->ensureModuleMap()->fetch(url);
|
| + return true;
|
| + }
|
| +
|
| + FetchRequest request(ResourceRequest(url), m_element->localName());
|
|
|
| CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(
|
| m_element->fastGetAttribute(HTMLNames::crossoriginAttr));
|
|
|