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

Unified Diff: third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp

Issue 1706243002: Don't use SVG resource documents with an unrecognized MIME-type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use testharness; add unit test for extractMIMETypeFromMediaType Created 4 years, 10 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
Index: third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp b/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp
index 50649c2936cc3640e23ff493555eaf6d0fc5520c..eaef68a709decb251b6b26b511a9d2917cef906d 100644
--- a/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp
@@ -32,7 +32,6 @@
#include "core/fetch/ResourceFetcher.h"
#include "core/fetch/StyleSheetResourceClient.h"
#include "platform/SharedBuffer.h"
-#include "platform/network/HTTPParsers.h"
#include "wtf/CurrentTime.h"
namespace blink {
@@ -105,11 +104,6 @@ const String CSSStyleSheetResource::sheetText(MIMETypeCheck mimeTypeCheck) const
return decodedText();
}
-const AtomicString CSSStyleSheetResource::mimeType() const
-{
- return extractMIMETypeFromMediaType(response().httpHeaderField(HTTPNames::Content_Type)).lower();
-}
-
void CSSStyleSheetResource::checkNotify()
{
// Decode the data to find out the encoding and keep the sheet text around during checkNotify()
@@ -153,7 +147,8 @@ bool CSSStyleSheetResource::canUseSheet(MIMETypeCheck mimeTypeCheck) const
// folks can use standards mode for local HTML documents.
if (mimeTypeCheck == MIMETypeCheck::Lax)
return true;
- return mimeType().isEmpty() || equalIgnoringCase(mimeType(), "text/css") || equalIgnoringCase(mimeType(), "application/x-unknown-content-type");
+ AtomicString contentType = httpContentType();
+ return contentType.isEmpty() || equalIgnoringCase(contentType, "text/css") || equalIgnoringCase(contentType, "application/x-unknown-content-type");
}
PassRefPtrWillBeRawPtr<StyleSheetContents> CSSStyleSheetResource::restoreParsedStyleSheet(const CSSParserContext& context)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h ('k') | third_party/WebKit/Source/core/fetch/DocumentResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698