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

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: Move check to shouldPreload(). Remove deprecation artifacts. 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..62b5a2dca3b60f393dddfb858fa357445393b8ed 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,11 @@ 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))
Charlie Harrison 2016/11/04 14:37:08 Add { } blocks to the multi-line if statement (thi
cfredric 2016/11/04 17:40:33 Done.
+ return false;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698