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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 1501393003: Deprecate fetching stylesheets with unsupported type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 7d27e7cfbf7d07d2b40b7db27dfc3c9d00c72e44..bd2bb628a9ee33a605bb22b4585fdbe135484008 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -591,6 +591,11 @@ bool LinkStyle::styleSheetIsLoading() const
return m_sheet->contents()->isLoading();
}
+bool LinkStyle::styleSheetTypeIsSupported(const String& type) const
esprehn 2015/12/17 07:07:07 This is static it doesn't need to be a method, mov
suzyh_UTC10 (ex-contributor) 2016/01/18 07:28:27 Done.
+{
+ return type.isEmpty() || type.contains("text/css");
+}
+
void LinkStyle::addPendingSheet(PendingSheetType type)
{
if (type <= m_pendingSheetType)
@@ -695,7 +700,7 @@ void LinkStyle::process()
if (!m_owner->loadLink(type, as, builder.url()))
return;
- if (m_disabledState != Disabled && m_owner->relAttribute().isStyleSheet() && shouldLoadResource() && builder.url().isValid()) {
+ if (m_disabledState != Disabled && m_owner->relAttribute().isStyleSheet() && styleSheetTypeIsSupported(type) && shouldLoadResource() && builder.url().isValid()) {
if (resource()) {
removePendingSheet();

Powered by Google App Engine
This is Rietveld 408576698