Chromium Code Reviews| 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(); |