Index: third_party/WebKit/Source/core/dom/ScriptLoader.h |
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h |
index 1aa042e4071a352296d0f786d2a284e8fb07ef15..001309da07569b21fc1fc4b2dc4da98e6b01420b 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h |
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h |
@@ -23,6 +23,7 @@ |
#include "core/CoreExport.h" |
#include "core/dom/PendingScript.h" |
+#include "core/dom/Script.h" |
#include "core/dom/ScriptRunner.h" |
#include "core/loader/resource/ScriptResource.h" |
#include "platform/loader/fetch/FetchParameters.h" |
@@ -58,7 +59,8 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>, |
static bool IsValidScriptTypeAndLanguage( |
const String& type_attribute_value, |
const String& language_attribute_value, |
- LegacyTypeSupport support_legacy_types); |
+ LegacyTypeSupport support_legacy_types, |
+ ScriptType& out_script_type); |
// https://html.spec.whatwg.org/#prepare-a-script |
bool PrepareScript(const TextPosition& script_start_position = |
@@ -78,7 +80,8 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>, |
// XML parser calls these |
void DispatchLoadEvent(); |
void DispatchErrorEvent(); |
- bool IsScriptTypeSupported(LegacyTypeSupport) const; |
+ bool IsScriptTypeSupported(LegacyTypeSupport, |
+ ScriptType& out_script_type) const; |
bool HaveFiredLoadEvent() const { return have_fired_load_; } |
bool WillBeParserExecuted() const { return will_be_parser_executed_; } |
@@ -94,6 +97,7 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>, |
bool IsParserInserted() const { return parser_inserted_; } |
bool AlreadyStarted() const { return already_started_; } |
bool IsNonBlocking() const { return non_blocking_; } |
+ ScriptType GetScriptType() const { return script_type_; } |
// Helper functions used by our parent classes. |
void DidNotifySubtreeInsertionsToDocument(); |
@@ -163,7 +167,11 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>, |
bool ready_to_be_parser_executed_ = false; |
// https://html.spec.whatwg.org/#concept-script-type |
- // TODO(hiroshige): Implement "script's type". |
+ // "It is determined when the script is prepared" |
+ // TODO(hiroshige): Currently |script_type_| is set but ignored, and |
+ // thus is handled as if it is a classic script even if type is "module" |
+ // and module scripts is enabled. |
+ ScriptType script_type_ = ScriptType::kClassic; |
// https://html.spec.whatwg.org/#concept-script-external |
// "It is determined when the script is prepared" |