| 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 509ada508bc91f09185715b23e193a561e30e1dc..a6972442f4dfd4d6e5723d01da55d711d1fcfa45 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
|
| @@ -34,6 +34,7 @@
|
| #include "core/css/MediaValuesCached.h"
|
| #include "core/css/parser/SizesAttributeParser.h"
|
| #include "core/dom/Document.h"
|
| +#include "core/dom/ScriptLoader.h"
|
| #include "core/fetch/IntegrityMetadata.h"
|
| #include "core/frame/LocalFrame.h"
|
| #include "core/frame/Settings.h"
|
| @@ -222,7 +223,6 @@ public:
|
| }
|
| }
|
|
|
| -
|
| TextPosition position = TextPosition(source.currentLine(), source.currentColumn());
|
| FetchRequest::ResourceWidth resourceWidth;
|
| float sourceSize = m_sourceSize;
|
| @@ -248,6 +248,11 @@ public:
|
| request->setCharset(charset());
|
| request->setDefer(m_defer);
|
| request->setIntegrityMetadata(m_integrityMetadata);
|
| +
|
| + // TODO(csharrison): Once this is deprecated, just abort the request
|
| + // here.
|
| + if (match(m_tagImpl, scriptTag) && !ScriptLoader::isValidScriptTypeAndLanguage(m_typeAttributeValue, m_languageAttributeValue, ScriptLoader::AllowLegacyTypeInTypeAttribute))
|
| + request->setScriptHasInvalidTypeOrLanguage();
|
| return request;
|
| }
|
|
|
| @@ -276,6 +281,10 @@ private:
|
| // explanation.
|
| else if (match(attributeName, integrityAttr))
|
| SubresourceIntegrity::parseIntegrityAttribute(attributeValue, m_integrityMetadata);
|
| + else if (match(attributeName, typeAttr))
|
| + m_typeAttributeValue = attributeValue;
|
| + else if (match(attributeName, languageAttr))
|
| + m_languageAttributeValue = attributeValue;
|
| }
|
|
|
| template<typename NameType>
|
| @@ -482,6 +491,8 @@ private:
|
| String m_imgSrcUrl;
|
| String m_srcsetAttributeValue;
|
| String m_asAttributeValue;
|
| + String m_typeAttributeValue;
|
| + String m_languageAttributeValue;
|
| float m_sourceSize;
|
| bool m_sourceSizeSet;
|
| FetchRequest::DeferOption m_defer;
|
|
|