Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 2473113002: Stop preloading scripts that have invalid type/language attributes (Closed)
Patch Set: Update layout test, add {} block Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 033b23ec59443b17c6bbfb5e954dda2ce9bf0405..e1a508554149cb2bcbc1d6ed3a1235d749a49d2d 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -253,12 +253,6 @@ class TokenPreloadScanner::StartTagScanner {
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;
}
@@ -484,6 +478,12 @@ class TokenPreloadScanner::StartTagScanner {
return false;
if (match(m_tagImpl, inputTag) && !m_inputIsImage)
return false;
+ if (match(m_tagImpl, scriptTag) &&
+ !ScriptLoader::isValidScriptTypeAndLanguage(
+ m_typeAttributeValue, m_languageAttributeValue,
+ ScriptLoader::AllowLegacyTypeInTypeAttribute)) {
+ return false;
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698