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 521b2ad779c311c6413ca9e8e061e94b3d777dfe..01508aac618e589b98a4a29c9b8474699b34d2dc 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
@@ -51,6 +51,8 @@ |
#include "core/loader/FrameLoaderClient.h" |
#include "core/loader/NetworkHintsInterface.h" |
#include "core/style/StyleInheritedData.h" |
+#include "platform/ContentType.h" |
+#include "platform/MIMETypeRegistry.h" |
#include "platform/RuntimeEnabledFeatures.h" |
#include "public/platform/Platform.h" |
#include "wtf/StdLibExtras.h" |
@@ -126,6 +128,12 @@ static LinkEventSender& linkLoadEventSender() |
return *sharedLoadEventSender; |
} |
+static bool styleSheetTypeIsSupported(const String& type) |
+{ |
+ String trimmedType = ContentType(type).type(); |
+ return trimmedType.isEmpty() || MIMETypeRegistry::isSupportedStyleSheetMIMEType(trimmedType); |
+} |
+ |
void HTMLLinkElement::parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes) |
{ |
ASSERT(iconSizes.isEmpty()); |
@@ -713,6 +721,8 @@ void LinkStyle::process() |
return; |
if (m_disabledState != Disabled && m_owner->relAttribute().isStyleSheet() && shouldLoadResource() && builder.url().isValid()) { |
+ if (!styleSheetTypeIsSupported(type)) |
+ UseCounter::countDeprecation(document(), UseCounter::NonCSSStyleSheetType); |
if (resource()) { |
removePendingSheet(); |