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

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: Updated tests, converted from fix to deprecation warning Created 4 years, 11 months 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 148eba27bca841209b44c02459e4d5a4ceb6849d..dff20833b7610beecd6f8d17b9d995fc3733e671 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -126,6 +126,11 @@ static LinkEventSender& linkLoadEventSender()
return *sharedLoadEventSender;
}
+static bool styleSheetTypeIsSupported(const String& type)
+{
+ return type.isEmpty() || type.contains("text/css");
Yoav Weiss 2016/01/18 08:21:18 This should be a case agnostic comparison, and sho
suzyh_UTC10 (ex-contributor) 2016/01/19 01:58:12 I've plumbed it through platform/MimeTypeRegistry
+}
+
void HTMLLinkElement::parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes)
{
ASSERT(iconSizes.isEmpty());
@@ -701,6 +706,9 @@ void LinkStyle::process()
if (!m_owner->loadLink(type, as, builder.url()))
return;
+ if (!styleSheetTypeIsSupported(type))
+ UseCounter::countDeprecation(document(), UseCounter::NonCSSStylesheetType);
+
if (m_disabledState != Disabled && m_owner->relAttribute().isStyleSheet() && shouldLoadResource() && builder.url().isValid()) {
if (resource()) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698