Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
| index ac9f57685fa59c327e5caace1e1f3f26a9554334..67a73c1befe91f60297b07e6b43fcf3dc4e7d8fc 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
| @@ -144,6 +144,7 @@ class TokenPreloadScanner::StartTagScanner { |
| link_is_import_(false), |
| matched_(true), |
| input_is_image_(false), |
| + nomodule_attribute_value_(false), |
| source_size_(0), |
| source_size_set_(false), |
| defer_(FetchParameters::kNoDefer), |
| @@ -289,6 +290,8 @@ class TokenPreloadScanner::StartTagScanner { |
| type_attribute_value_ = attribute_value; |
| else if (Match(attribute_name, languageAttr)) |
| language_attribute_value_ = attribute_value; |
| + else if (Match(attribute_name, nomoduleAttr)) |
| + nomodule_attribute_value_ = true; |
| } |
| template <typename NameType> |
| @@ -522,11 +525,16 @@ class TokenPreloadScanner::StartTagScanner { |
| if (Match(tag_impl_, inputTag) && !input_is_image_) |
| return false; |
| ScriptType script_type = ScriptType::kClassic; |
|
hiroshige
2017/04/19 21:15:33
nit: this declaration can be moved inside if() blo
Nate Chapin
2017/04/19 21:54:32
Done.
|
| - if (Match(tag_impl_, scriptTag) && |
| - !ScriptLoader::IsValidScriptTypeAndLanguage( |
| - type_attribute_value_, language_attribute_value_, |
| - ScriptLoader::kAllowLegacyTypeInTypeAttribute, script_type)) { |
| - return false; |
| + if (Match(tag_impl_, scriptTag)) { |
| + if (!ScriptLoader::IsValidScriptTypeAndLanguage( |
| + type_attribute_value_, language_attribute_value_, |
| + ScriptLoader::kAllowLegacyTypeInTypeAttribute, script_type)) { |
| + return false; |
| + } |
| + if (ScriptLoader::BlockForNoModule(script_type, |
| + nomodule_attribute_value_)) { |
| + return false; |
| + } |
| } |
| return true; |
| } |
| @@ -556,6 +564,7 @@ class TokenPreloadScanner::StartTagScanner { |
| String as_attribute_value_; |
| String type_attribute_value_; |
| String language_attribute_value_; |
| + bool nomodule_attribute_value_; |
| float source_size_; |
| bool source_size_set_; |
| FetchParameters::DeferOption defer_; |