Chromium Code Reviews| 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..710799d53e47d546b5c89e270b5257e3da757697 100644 |
| --- a/third_party/WebKit/Source/core/dom/ScriptLoader.h |
| +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h |
| @@ -58,7 +58,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 +79,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 +96,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 +166,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; |
|
kouhei (in TOK)
2017/04/15 01:18:23
Should we have "invalid" ScriptType so that we can
|
| // https://html.spec.whatwg.org/#concept-script-external |
| // "It is determined when the script is prepared" |