WebKit Bugzilla
Attachment 360239 Details for
Bug 182325
: Align with Fetch on data: URLs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-182325-20190126172006.patch (text/plain), 39.29 KB, created by
Rob Buis
on 2019-01-26 08:20:08 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2019-01-26 08:20:08 PST
Size:
39.29 KB
patch
obsolete
>Subversion Revision: 240546 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f81fccd97ebfae4cc84ab77266ed9b96c96a6622..636aed7a0beee2cade8a61000003a039f342d932 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2019-01-26 Rob Buis <rbuis@igalia.com> >+ >+ Align with Fetch on data: URLs >+ https://bugs.webkit.org/show_bug.cgi?id=182325 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: web-platform-tests/fetch/data-urls/processing.any.js >+ >+ * Modules/encryptedmedia/CDM.cpp: >+ (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType): >+ * platform/network/DataURLDecoder.cpp: >+ (WebCore::DataURLDecoder::parseMediaType): >+ (WebCore::DataURLDecoder::DecodeTask::process): >+ * platform/network/ParsedContentType.cpp: >+ (WebCore::ParsedContentType::parseContentType): >+ (WebCore::ParsedContentType::ParsedContentType): >+ (WebCore::DummyParsedContentType::setContentType const): Deleted. >+ (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted. >+ (WebCore::parseContentType): Deleted. >+ (WebCore::isValidContentType): Deleted. >+ * platform/network/ParsedContentType.h: >+ (WebCore::ParsedContentType::isValid const): >+ * xml/XMLHttpRequest.cpp: >+ (WebCore::XMLHttpRequest::send): >+ (WebCore::XMLHttpRequest::overrideMimeType): >+ > 2019-01-26 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height. >diff --git a/Source/WebCore/Modules/encryptedmedia/CDM.cpp b/Source/WebCore/Modules/encryptedmedia/CDM.cpp >index ebf067f7b57f16c330b5d740438834222efabd8f..72445819d3eb38f2df9da57f38533e7ba98f9de0 100644 >--- a/Source/WebCore/Modules/encryptedmedia/CDM.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/CDM.cpp >@@ -432,12 +432,12 @@ Optional<Vector<MediaKeySystemMediaCapability>> CDM::getSupportedCapabilitiesFor > if (requestedCapability.contentType.isEmpty()) > return WTF::nullopt; > >+ ParsedContentType contentType { requestedCapability.contentType, Mode::Rfc2045 }; > // 3.4. If content type is an invalid or unrecognized MIME type, continue to the next iteration. >- if (!isValidContentType(requestedCapability.contentType, Mode::Rfc2045)) >+ if (!contentType.isValid()) > continue; > > // 3.5. Let container be the container type specified by content type. >- ParsedContentType contentType { requestedCapability.contentType }; > String container = contentType.mimeType(); > > // 3.6. If the user agent does not support container, continue to the next iteration. The case-sensitivity >diff --git a/Source/WebCore/platform/network/DataURLDecoder.cpp b/Source/WebCore/platform/network/DataURLDecoder.cpp >index 59ddf074a5f32c50a1b76cd10dec88bcac851de7..17bbe09334c7844abdf7e00fc92264e89bcb8952 100644 >--- a/Source/WebCore/platform/network/DataURLDecoder.cpp >+++ b/Source/WebCore/platform/network/DataURLDecoder.cpp >@@ -28,6 +28,7 @@ > > #include "DecodeEscapeSequences.h" > #include "HTTPParsers.h" >+#include "ParsedContentType.h" > #include "SharedBuffer.h" > #include "TextEncoding.h" > #include <wtf/MainThread.h> >@@ -47,18 +48,13 @@ static WorkQueue& decodeQueue() > > static Result parseMediaType(const String& mediaType) > { >- auto mimeType = extractMIMETypeFromMediaType(mediaType); >- auto charset = extractCharsetFromMediaType(mediaType); >- >- // https://tools.ietf.org/html/rfc2397 >- // If <mediatype> is omitted, it defaults to text/plain;charset=US-ASCII. As a shorthand, >- // "text/plain" can be omitted but the charset parameter supplied. >- if (mimeType.isEmpty()) { >- mimeType = "text/plain"_s; >- if (charset.isEmpty()) >- charset = "US-ASCII"_s; >- } >- return { mimeType, charset, !mediaType.isEmpty() ? mediaType : "text/plain;charset=US-ASCII", nullptr }; >+ ParsedContentType parsedContentType(mediaType); >+ if (!parsedContentType.isValid()) >+ return { "text/plain"_s, "US-ASCII"_s, "text/plain;charset=US-ASCII"_s, nullptr }; >+ auto mimeType = parsedContentType.mimeType(); >+ auto charset = parsedContentType.charset(); >+ >+ return { mimeType, charset, mediaType, nullptr }; > } > > struct DecodeTask { >@@ -87,6 +83,9 @@ public: > auto header = StringView(urlString).substring(strlen(dataString), headerEnd - strlen(dataString)); > isBase64 = header.endsWithIgnoringASCIICase(StringView(base64String)); > auto mediaType = (isBase64 ? header.substring(0, header.length() - strlen(base64String)) : header).toString(); >+ mediaType = mediaType.stripWhiteSpace(); >+ if (mediaType.startsWith(';')) >+ mediaType.insert("text/plain", 0); > result = parseMediaType(mediaType); > > return true; >diff --git a/Source/WebCore/platform/network/ParsedContentType.cpp b/Source/WebCore/platform/network/ParsedContentType.cpp >index e3eabd99903c69b2149f09fa03d09b4b5bcc9f2e..66afb621b0d5180c6211e3e3d23eaaf949059c6f 100644 >--- a/Source/WebCore/platform/network/ParsedContentType.cpp >+++ b/Source/WebCore/platform/network/ParsedContentType.cpp >@@ -36,12 +36,6 @@ > > namespace WebCore { > >-class DummyParsedContentType { >-public: >- void setContentType(const SubstringRange&, Mode) const { } >- void setContentTypeParameter(const String&, const String&, Mode) const { } >-}; >- > static void skipSpaces(const String& input, unsigned& startIndex) > { > while (startIndex < input.length() && input[startIndex] == ' ') >@@ -189,64 +183,66 @@ static bool isNotSemicolonOrEqualSign(UChar ch) > return ch != ';' && ch != '='; > } > >-template <class ReceiverType> >-bool parseContentType(const String& contentType, ReceiverType& receiver, Mode mode) >+void ParsedContentType::parseContentType(const String& contentType, Mode mode) > { >+ if (contentType.contains('\r') || contentType.contains('\n')) >+ return; > unsigned index = 0; > unsigned contentTypeLength = contentType.length(); > skipSpaces(contentType, index); > if (index >= contentTypeLength) { > LOG_ERROR("Invalid Content-Type string '%s'", contentType.ascii().data()); >- return false; >+ return; > } > > unsigned contentTypeStart = index; > auto typeRange = parseToken(contentType, index, isNotForwardSlash, mode); > if (!typeRange || containsNonTokenCharacters(contentType, *typeRange)) { > LOG_ERROR("Invalid Content-Type, invalid type value."); >- return false; >+ return; > } > > if (contentType[index++] != '/') { > LOG_ERROR("Invalid Content-Type, missing '/'."); >- return false; >+ return; > } > > auto subTypeRange = parseToken(contentType, index, isNotSemicolon, mode, mode == Mode::MimeSniff); > if (!subTypeRange || containsNonTokenCharacters(contentType, *subTypeRange)) { > LOG_ERROR("Invalid Content-Type, invalid subtype value."); >- return false; >+ return; > } > > // There should not be any quoted strings until we reach the parameters. > size_t semiColonIndex = contentType.find(';', contentTypeStart); > if (semiColonIndex == notFound) { >- receiver.setContentType(SubstringRange(contentTypeStart, contentTypeLength - contentTypeStart), mode); >- return true; >+ setContentType(SubstringRange(contentTypeStart, contentTypeLength - contentTypeStart), mode); >+ m_isValid = true; >+ return; > } > >- receiver.setContentType(SubstringRange(contentTypeStart, semiColonIndex - contentTypeStart), mode); >+ setContentType(SubstringRange(contentTypeStart, semiColonIndex - contentTypeStart), mode); > index = semiColonIndex + 1; > while (true) { > skipSpaces(contentType, index); > auto keyRange = parseToken(contentType, index, isNotSemicolonOrEqualSign, mode); > if (mode == Mode::Rfc2045 && (!keyRange || index >= contentTypeLength)) { > LOG_ERROR("Invalid Content-Type parameter name."); >- return false; >+ return; > } > > // Should we tolerate spaces here? > if (mode == Mode::Rfc2045) { > if (contentType[index++] != '=' || index >= contentTypeLength) { > LOG_ERROR("Invalid Content-Type malformed parameter."); >- return false; >+ return; > } > } else { > if (index >= contentTypeLength) > break; > if (contentType[index] != '=' && contentType[index] != ';') { > LOG_ERROR("Invalid Content-Type malformed parameter."); >- return false; >+ return; > } > if (contentType[index++] == ';') > continue; >@@ -264,39 +260,34 @@ bool parseContentType(const String& contentType, ReceiverType& receiver, Mode mo > valueRange = parseToken(contentType, index, isNotSemicolon, mode, mode == Mode::MimeSniff); > > if (!valueRange) { >+ if (mode == Mode::MimeSniff) >+ continue; > LOG_ERROR("Invalid Content-Type, invalid parameter value."); >- return false; >+ return; > } > > String parameterValue = substringForRange(contentType, *valueRange); > // Should we tolerate spaces here? > if (mode == Mode::Rfc2045 && index < contentTypeLength && contentType[index++] != ';') { > LOG_ERROR("Invalid Content-Type, invalid character at the end of key/value parameter."); >- return false; >+ return; > } > >- receiver.setContentTypeParameter(parameterName, parameterValue, mode); >+ setContentTypeParameter(parameterName, parameterValue, mode); > >- if (index >= contentTypeLength) >- return true; >+ if (index >= contentTypeLength) { >+ m_isValid = true; >+ return; >+ } > } > >- return true; >-} >- >-bool isValidContentType(const String& contentType, Mode mode) >-{ >- if (contentType.contains('\r') || contentType.contains('\n')) >- return false; >- >- DummyParsedContentType parsedContentType = DummyParsedContentType(); >- return parseContentType<DummyParsedContentType>(contentType, parsedContentType, mode); >+ m_isValid = true; > } > > ParsedContentType::ParsedContentType(const String& contentType, Mode mode) > : m_contentType(contentType.stripWhiteSpace()) > { >- parseContentType<ParsedContentType>(m_contentType, *this, mode); >+ parseContentType(m_contentType, mode); > } > > String ParsedContentType::charset() const >@@ -341,4 +332,9 @@ void ParsedContentType::setContentTypeParameter(const String& keyName, const Str > m_parameters.set(keyName, keyValue); > } > >+bool ParsedContentType::isValid() const >+{ >+ return m_isValid; >+} >+ > } >diff --git a/Source/WebCore/platform/network/ParsedContentType.h b/Source/WebCore/platform/network/ParsedContentType.h >index 949010b7270c7c7045fc2ab0ba5c35496dc0dd79..423fdc38e06e3d599c1c5dd10ef73d1dee73ee21 100644 >--- a/Source/WebCore/platform/network/ParsedContentType.h >+++ b/Source/WebCore/platform/network/ParsedContentType.h >@@ -42,12 +42,11 @@ enum class Mode { > }; > // <index, length> > typedef std::pair<unsigned, unsigned> SubstringRange; >-WEBCORE_EXPORT bool isValidContentType(const String&, Mode = Mode::MimeSniff); > > // FIXME: add support for comments. > class ParsedContentType { > public: >- explicit ParsedContentType(const String&, Mode = Mode::MimeSniff); >+ WEBCORE_EXPORT explicit ParsedContentType(const String&, Mode = Mode::MimeSniff); > > String mimeType() const { return m_mimeType; } > String charset() const; >@@ -56,9 +55,10 @@ public: > String parameterValueForName(const String&) const; > size_t parameterCount() const; > >+ WEBCORE_EXPORT bool isValid() const; >+ > private: >- template<class ReceiverType> >- friend bool parseContentType(const String&, ReceiverType&, Mode); >+ void parseContentType(const String&, Mode); > void setContentType(const SubstringRange&, Mode); > void setContentTypeParameter(const String&, const String&, Mode); > >@@ -66,6 +66,7 @@ private: > String m_contentType; > KeyValuePairs m_parameters; > String m_mimeType; >+ bool m_isValid { false }; > }; > > } >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index 5116457da85ff17341431f6da5f88ec6773955e4..ce8e463d9f1113d5e345c9a2818204165861b8cd 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -525,7 +525,7 @@ ExceptionOr<void> XMLHttpRequest::send(Blob& body) > if (m_method != "GET" && m_method != "HEAD" && m_url.protocolIsInHTTPFamily()) { > if (!m_requestHeaders.contains(HTTPHeaderName::ContentType)) { > const String& blobType = body.type(); >- if (!blobType.isEmpty() && isValidContentType(blobType)) >+ if (!blobType.isEmpty() && ParsedContentType(blobType).isValid()) > m_requestHeaders.set(HTTPHeaderName::ContentType, blobType); > else { > // From FileAPI spec, whenever media type cannot be determined, empty string must be returned. >@@ -785,7 +785,7 @@ ExceptionOr<void> XMLHttpRequest::overrideMimeType(const String& mimeType) > return Exception { InvalidStateError }; > > m_mimeTypeOverride = "application/octet-stream"_s; >- if (isValidContentType(mimeType)) >+ if (ParsedContentType(mimeType).isValid()) > m_mimeTypeOverride = mimeType; > > return { }; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index eba8e91d9944037712c4062435c6205c076119ca..76847eb7b3c24cef83f1a088789b860b038e9aca 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-26 Rob Buis <rbuis@igalia.com> >+ >+ Align with Fetch on data: URLs >+ https://bugs.webkit.org/show_bug.cgi?id=182325 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp: >+ (TestWebKitAPI::TEST): >+ > 2019-01-26 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height. >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp b/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp >index 45b88946af76a26dca5959d311da45ad4678cec6..b827c0d4c9b2d9bdc8c2ef95ae492a0aa571aaf3 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp >@@ -34,66 +34,68 @@ namespace TestWebKitAPI { > > TEST(ParsedContentType, MimeSniff) > { >- EXPECT_TRUE(isValidContentType("text/plain", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType(" text/plain", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType(" text/plain ", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("text /plain", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("text/ plain", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("text / plain", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("te xt/plain", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("text/pla in", Mode::MimeSniff)); >+ EXPECT_TRUE(ParsedContentType("text/plain", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType(" text/plain", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType(" text/plain ", Mode::MimeSniff).isValid()); >+ EXPECT_FALSE(ParsedContentType("text /plain", Mode::MimeSniff).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/ plain", Mode::MimeSniff).isValid()); >+ EXPECT_FALSE(ParsedContentType("text / plain", Mode::MimeSniff).isValid()); >+ EXPECT_FALSE(ParsedContentType("te xt/plain", Mode::MimeSniff).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/pla in", Mode::MimeSniff).isValid()); > >- EXPECT_FALSE(isValidContentType("text", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("text/", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("/plain", Mode::MimeSniff)); >+ EXPECT_FALSE(ParsedContentType("text", Mode::MimeSniff).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/", Mode::MimeSniff).isValid()); >+ EXPECT_FALSE(ParsedContentType("/plain", Mode::MimeSniff).isValid()); > >- EXPECT_TRUE(isValidContentType("text/plain;", Mode::MimeSniff)); >+ EXPECT_TRUE(ParsedContentType("text/plain;", Mode::MimeSniff).isValid()); > >- EXPECT_TRUE(isValidContentType("text/plain;test", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain; test", Mode::MimeSniff)); >- EXPECT_FALSE(isValidContentType("text/plain;test=", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain;test=value", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain; test=value", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain;test =value", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain;test= value", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain;test=value ", Mode::MimeSniff)); >+ EXPECT_TRUE(ParsedContentType("text/plain;test", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain; test", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=;test=value", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=value", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain; test=value", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test =value", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test= value", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=value ", Mode::MimeSniff).isValid()); > >- EXPECT_TRUE(isValidContentType("text/plain;test=\"value\"", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain;test=\"value", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain;test=\"value\"foo", Mode::MimeSniff)); >- EXPECT_TRUE(isValidContentType("text/plain;test=\"value\"foo;foo=bar", Mode::MimeSniff)); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=\"value\"", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=\"value", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=\"value\"foo", Mode::MimeSniff).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=\"value\"foo;foo=bar", Mode::MimeSniff).isValid()); > } > > TEST(ParsedContentType, Rfc2045) > { >- EXPECT_TRUE(isValidContentType("text/plain", Mode::Rfc2045)); >- EXPECT_TRUE(isValidContentType(" text/plain", Mode::Rfc2045)); >- EXPECT_TRUE(isValidContentType(" text/plain ", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text /plain", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/ plain", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text / plain", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("te xt/plain", Mode::Rfc2045)); >- EXPECT_TRUE(isValidContentType("text/pla in", Mode::Rfc2045)); >+ EXPECT_TRUE(ParsedContentType("text/plain", Mode::Rfc2045).isValid()); >+ EXPECT_TRUE(ParsedContentType(" text/plain", Mode::Rfc2045).isValid()); >+ EXPECT_TRUE(ParsedContentType(" text/plain ", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text /plain", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/ plain", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text / plain", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("te xt/plain", Mode::Rfc2045).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/pla in", Mode::Rfc2045).isValid()); > >- EXPECT_FALSE(isValidContentType("text", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("/plain", Mode::Rfc2045)); >+ EXPECT_FALSE(ParsedContentType("text", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("/plain", Mode::Rfc2045).isValid()); > >- EXPECT_FALSE(isValidContentType("text/plain;", Mode::Rfc2045)); >+ EXPECT_FALSE(ParsedContentType("text/plain;", Mode::Rfc2045).isValid()); > >- EXPECT_FALSE(isValidContentType("text/plain;test", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain; test", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain;test=", Mode::Rfc2045)); >- EXPECT_TRUE(isValidContentType("text/plain;test=value", Mode::Rfc2045)); >- EXPECT_TRUE(isValidContentType("text/plain; test=value", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain;test =value", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain;test= value", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain;test=value ", Mode::Rfc2045)); >+ EXPECT_FALSE(ParsedContentType("text/plain;test", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain; test", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test=", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test=;test=value", Mode::Rfc2045).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=value", Mode::Rfc2045).isValid()); >+ EXPECT_TRUE(ParsedContentType("text/plain; test=value", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test =value", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test= value", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test=value ", Mode::Rfc2045).isValid()); > >- EXPECT_TRUE(isValidContentType("text/plain;test=\"value\"", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain;test=\"value", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain;test=\"value\"foo", Mode::Rfc2045)); >- EXPECT_FALSE(isValidContentType("text/plain;test=\"value\"foo;foo=bar", Mode::Rfc2045)); >+ EXPECT_TRUE(ParsedContentType("text/plain;test=\"value\"", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test=\"value", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test=\"value\"foo", Mode::Rfc2045).isValid()); >+ EXPECT_FALSE(ParsedContentType("text/plain;test=\"value\"foo;foo=bar", Mode::Rfc2045).isValid()); > } > > } // namespace TestWebKitAPI >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index ec057412ce368bd74036ff1436c6a5caf449c7af..8d183da41de5b43d84db6d594db805088c5585f0 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-26 Rob Buis <rbuis@igalia.com> >+ >+ Align with Fetch on data: URLs >+ https://bugs.webkit.org/show_bug.cgi?id=182325 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update improved test expectations. >+ >+ * web-platform-tests/fetch/data-urls/processing.any-expected.txt: >+ * web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt: >+ > 2019-01-24 Charles Vazac <cvazac@akamai.com> > > Implement PerformanceObserver.supportedEntryTypes >diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any-expected.txt >index c878ab6750bc237125f850d9691c7086a25eb590..43984861a146b8a29e23c0bf9916df49b9ffba8a 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any-expected.txt >@@ -3,7 +3,7 @@ CONSOLE MESSAGE: Fetch API cannot load data:text/html. > CONSOLE MESSAGE: Fetch API cannot load data:text/html ;charset=x. > > PASS Setup. >-FAIL "data://test/,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "//test/" >+PASS "data://test/,X" > PASS "data://test:test/,X" > PASS "data:,X" > PASS "data:" >@@ -13,30 +13,30 @@ PASS "data:," > FAIL "data:,X#X" assert_array_equals: lengths differ, expected 1 got 3 > PASS "data:,%FF" > PASS "data:text/plain,X" >-FAIL "data:text/plain ,X" assert_equals: expected (string) "text/plain" but got (object) null >+PASS "data:text/plain ,X" > PASS "data:text/plain%20,X" > FAIL "data:text/plain\f,X" assert_equals: expected "text/plain%0c" but got "text/plain%0C" > FAIL "data:text/plain%0C,X" assert_equals: expected "text/plain%0c" but got "text/plain%0C" > FAIL "data:text/plain;,X" assert_equals: expected "text/plain" but got "text/plain;" >-FAIL "data:;x=x;charset=x,X" assert_equals: expected "text/plain;x=x;charset=x" but got ";x=x;charset=x" >-FAIL "data:;x=x,X" assert_equals: expected "text/plain;x=x" but got ";x=x" >+PASS "data:;x=x;charset=x,X" >+PASS "data:;x=x,X" > PASS "data:text/plain;charset=windows-1252,%C2%B1" > FAIL "data:text/plain;Charset=UTF-8,%C2%B1" assert_equals: expected "text/plain;charset=UTF-8" but got "text/plain;Charset=UTF-8" > PASS "data:image/gif,%C2%B1" > FAIL "data:IMAGE/gif,%C2%B1" assert_equals: expected "image/gif" but got "IMAGE/gif" > FAIL "data:IMAGE/gif;hi=x,%C2%B1" assert_equals: expected "image/gif;hi=x" but got "IMAGE/gif;hi=x" > FAIL "data:IMAGE/gif;CHARSET=x,%C2%B1" assert_equals: expected "image/gif;charset=x" but got "IMAGE/gif;CHARSET=x" >-FAIL "data: ,%FF" assert_equals: expected (string) "text/plain;charset=US-ASCII" but got (object) null >-FAIL "data:%20,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%20" >-FAIL "data:\f,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%0C" >-FAIL "data:%1F,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%1F" >-FAIL "data:\0,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%00" >-FAIL "data:%00,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%00" >-FAIL "data:text/html ,X" assert_equals: expected (string) "text/html" but got (object) null >-FAIL "data:text / html,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "text / html" >-FAIL "data:â ,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "%E2%80%A0" >+PASS "data: ,%FF" >+PASS "data:%20,%FF" >+PASS "data:\f,%FF" >+PASS "data:%1F,%FF" >+PASS "data:\0,%FF" >+PASS "data:%00,%FF" >+PASS "data:text/html ,X" >+PASS "data:text / html,X" >+PASS "data:â ,X" > FAIL "data:â /â ,X" assert_equals: expected "%e2%80%a0/%e2%80%a0" but got "%E2%80%A0/%E2%80%A0" >-FAIL "data:X,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "X" >+PASS "data:X,X" > PASS "data:image/png,X X" > PASS "data:application/javascript,X X" > PASS "data:application/xml,X X" >@@ -45,32 +45,32 @@ PASS "data:text/plain,X X" > PASS "data:unknown/unknown,X X" > FAIL "data:text/plain;a=\",\",X" assert_equals: expected "text/plain;a=\"\"" but got "text/plain;a=\"" > PASS "data:text/plain;a=%2C,X" >-FAIL "data:;base64;base64,WA" assert_equals: expected "text/plain" but got ";base64" >+FAIL "data:;base64;base64,WA" assert_equals: expected "text/plain" but got "text/plain;base64" > FAIL "data:x/x;base64;base64,WA" assert_equals: expected "x/x" but got "x/x;base64" > FAIL "data:x/x;base64;charset=x,WA" assert_equals: expected "x/x;charset=x" but got "x/x;base64;charset=x" > FAIL "data:x/x;base64;charset=x;base64,WA" assert_equals: expected "x/x;charset=x" but got "x/x;base64;charset=x" > FAIL "data:x/x;base64;base64x,WA" assert_equals: expected "x/x" but got "x/x;base64;base64x" > PASS "data:;base64,W%20A" > PASS "data:;base64,W%0CA" >-FAIL "data:x;base64x,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "x;base64x" >-FAIL "data:x;base64;x,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "x;base64;x" >-FAIL "data:x;base64=x,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "x;base64=x" >+PASS "data:x;base64x,WA" >+PASS "data:x;base64;x,WA" >+PASS "data:x;base64=x,WA" > FAIL "data:; base64,WA" assert_array_equals: lengths differ, expected 1 got 2 > FAIL "data:; base64,WA" assert_array_equals: lengths differ, expected 1 got 2 > FAIL "data: ;charset=x ; base64,WA" assert_array_equals: lengths differ, expected 1 got 2 >-FAIL "data:;base64;,WA" assert_equals: expected "text/plain" but got ";base64;" >+FAIL "data:;base64;,WA" assert_equals: expected "text/plain" but got "text/plain;base64;" > FAIL "data:;base64 ,WA" assert_array_equals: lengths differ, expected 1 got 2 > FAIL "data:;base64 ,WA" assert_array_equals: lengths differ, expected 1 got 2 >-FAIL "data:;base 64,WA" assert_equals: expected "text/plain" but got ";base 64" >+FAIL "data:;base 64,WA" assert_equals: expected "text/plain" but got "text/plain;base 64" > PASS "data:;BASe64,WA" >-FAIL "data:;%62ase64,WA" assert_equals: expected "text/plain" but got ";%62ase64" >-FAIL "data:%3Bbase64,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "%3Bbase64" >-FAIL "data:;charset=x,X" assert_equals: expected "text/plain;charset=x" but got ";charset=x" >-FAIL "data:; charset=x,X" assert_equals: expected "text/plain;charset=x" but got "; charset=x" >-FAIL "data:;charset =x,X" assert_equals: expected "text/plain" but got ";charset =x" >-FAIL "data:;charset= x,X" assert_equals: expected "text/plain;charset=\" x\"" but got ";charset= x" >-FAIL "data:;charset=,X" assert_equals: expected "text/plain" but got ";charset=" >-FAIL "data:;charset,X" assert_equals: expected "text/plain" but got ";charset" >-FAIL "data:;charset=\"x\",X" assert_equals: expected "text/plain;charset=x" but got ";charset=\"x\"" >-FAIL "data:;CHARSET=\"X\",X" assert_equals: expected "text/plain;charset=X" but got ";CHARSET=\"X\"" >+FAIL "data:;%62ase64,WA" assert_equals: expected "text/plain" but got "text/plain;%62ase64" >+PASS "data:%3Bbase64,WA" >+PASS "data:;charset=x,X" >+FAIL "data:; charset=x,X" assert_equals: expected "text/plain;charset=x" but got "text/plain; charset=x" >+FAIL "data:;charset =x,X" assert_equals: expected "text/plain" but got "text/plain;charset =x" >+FAIL "data:;charset= x,X" assert_equals: expected "text/plain;charset=\" x\"" but got "text/plain;charset= x" >+FAIL "data:;charset=,X" assert_equals: expected "text/plain" but got "text/plain;charset=" >+FAIL "data:;charset,X" assert_equals: expected "text/plain" but got "text/plain;charset" >+FAIL "data:;charset=\"x\",X" assert_equals: expected "text/plain;charset=x" but got "text/plain;charset=\"x\"" >+FAIL "data:;CHARSET=\"X\",X" assert_equals: expected "text/plain;charset=X" but got "text/plain;CHARSET=\"X\"" > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt >index 1c23aaadae8f3d5e97f221d22e75da13a2bfd58a..f624ea3820c27b5b5e0cf0ee356c52551255dd1c 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt >@@ -1,6 +1,6 @@ > > PASS Setup. >-FAIL "data://test/,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "//test/" >+PASS "data://test/,X" > PASS "data://test:test/,X" > PASS "data:,X" > PASS "data:" >@@ -10,30 +10,30 @@ PASS "data:," > FAIL "data:,X#X" assert_array_equals: lengths differ, expected 1 got 3 > PASS "data:,%FF" > PASS "data:text/plain,X" >-FAIL "data:text/plain ,X" assert_equals: expected (string) "text/plain" but got (object) null >+PASS "data:text/plain ,X" > PASS "data:text/plain%20,X" > FAIL "data:text/plain\f,X" assert_equals: expected "text/plain%0c" but got "text/plain%0C" > FAIL "data:text/plain%0C,X" assert_equals: expected "text/plain%0c" but got "text/plain%0C" > FAIL "data:text/plain;,X" assert_equals: expected "text/plain" but got "text/plain;" >-FAIL "data:;x=x;charset=x,X" assert_equals: expected "text/plain;x=x;charset=x" but got ";x=x;charset=x" >-FAIL "data:;x=x,X" assert_equals: expected "text/plain;x=x" but got ";x=x" >+PASS "data:;x=x;charset=x,X" >+PASS "data:;x=x,X" > PASS "data:text/plain;charset=windows-1252,%C2%B1" > FAIL "data:text/plain;Charset=UTF-8,%C2%B1" assert_equals: expected "text/plain;charset=UTF-8" but got "text/plain;Charset=UTF-8" > PASS "data:image/gif,%C2%B1" > FAIL "data:IMAGE/gif,%C2%B1" assert_equals: expected "image/gif" but got "IMAGE/gif" > FAIL "data:IMAGE/gif;hi=x,%C2%B1" assert_equals: expected "image/gif;hi=x" but got "IMAGE/gif;hi=x" > FAIL "data:IMAGE/gif;CHARSET=x,%C2%B1" assert_equals: expected "image/gif;charset=x" but got "IMAGE/gif;CHARSET=x" >-FAIL "data: ,%FF" assert_equals: expected (string) "text/plain;charset=US-ASCII" but got (object) null >-FAIL "data:%20,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%20" >-FAIL "data:\f,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%0C" >-FAIL "data:%1F,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%1F" >-FAIL "data:\0,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%00" >-FAIL "data:%00,%FF" assert_equals: expected "text/plain;charset=US-ASCII" but got "%00" >-FAIL "data:text/html ,X" assert_equals: expected (string) "text/html" but got (object) null >-FAIL "data:text / html,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "text / html" >-FAIL "data:â ,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "%E2%80%A0" >+PASS "data: ,%FF" >+PASS "data:%20,%FF" >+PASS "data:\f,%FF" >+PASS "data:%1F,%FF" >+PASS "data:\0,%FF" >+PASS "data:%00,%FF" >+PASS "data:text/html ,X" >+PASS "data:text / html,X" >+PASS "data:â ,X" > FAIL "data:â /â ,X" assert_equals: expected "%e2%80%a0/%e2%80%a0" but got "%E2%80%A0/%E2%80%A0" >-FAIL "data:X,X" assert_equals: expected "text/plain;charset=US-ASCII" but got "X" >+PASS "data:X,X" > PASS "data:image/png,X X" > PASS "data:application/javascript,X X" > PASS "data:application/xml,X X" >@@ -42,32 +42,32 @@ PASS "data:text/plain,X X" > PASS "data:unknown/unknown,X X" > FAIL "data:text/plain;a=\",\",X" assert_equals: expected "text/plain;a=\"\"" but got "text/plain;a=\"" > PASS "data:text/plain;a=%2C,X" >-FAIL "data:;base64;base64,WA" assert_equals: expected "text/plain" but got ";base64" >+FAIL "data:;base64;base64,WA" assert_equals: expected "text/plain" but got "text/plain;base64" > FAIL "data:x/x;base64;base64,WA" assert_equals: expected "x/x" but got "x/x;base64" > FAIL "data:x/x;base64;charset=x,WA" assert_equals: expected "x/x;charset=x" but got "x/x;base64;charset=x" > FAIL "data:x/x;base64;charset=x;base64,WA" assert_equals: expected "x/x;charset=x" but got "x/x;base64;charset=x" > FAIL "data:x/x;base64;base64x,WA" assert_equals: expected "x/x" but got "x/x;base64;base64x" > PASS "data:;base64,W%20A" > PASS "data:;base64,W%0CA" >-FAIL "data:x;base64x,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "x;base64x" >-FAIL "data:x;base64;x,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "x;base64;x" >-FAIL "data:x;base64=x,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "x;base64=x" >+PASS "data:x;base64x,WA" >+PASS "data:x;base64;x,WA" >+PASS "data:x;base64=x,WA" > FAIL "data:; base64,WA" assert_array_equals: lengths differ, expected 1 got 2 > FAIL "data:; base64,WA" assert_array_equals: lengths differ, expected 1 got 2 > FAIL "data: ;charset=x ; base64,WA" assert_array_equals: lengths differ, expected 1 got 2 >-FAIL "data:;base64;,WA" assert_equals: expected "text/plain" but got ";base64;" >+FAIL "data:;base64;,WA" assert_equals: expected "text/plain" but got "text/plain;base64;" > FAIL "data:;base64 ,WA" assert_array_equals: lengths differ, expected 1 got 2 > FAIL "data:;base64 ,WA" assert_array_equals: lengths differ, expected 1 got 2 >-FAIL "data:;base 64,WA" assert_equals: expected "text/plain" but got ";base 64" >+FAIL "data:;base 64,WA" assert_equals: expected "text/plain" but got "text/plain;base 64" > PASS "data:;BASe64,WA" >-FAIL "data:;%62ase64,WA" assert_equals: expected "text/plain" but got ";%62ase64" >-FAIL "data:%3Bbase64,WA" assert_equals: expected "text/plain;charset=US-ASCII" but got "%3Bbase64" >-FAIL "data:;charset=x,X" assert_equals: expected "text/plain;charset=x" but got ";charset=x" >-FAIL "data:; charset=x,X" assert_equals: expected "text/plain;charset=x" but got "; charset=x" >-FAIL "data:;charset =x,X" assert_equals: expected "text/plain" but got ";charset =x" >-FAIL "data:;charset= x,X" assert_equals: expected "text/plain;charset=\" x\"" but got ";charset= x" >-FAIL "data:;charset=,X" assert_equals: expected "text/plain" but got ";charset=" >-FAIL "data:;charset,X" assert_equals: expected "text/plain" but got ";charset" >-FAIL "data:;charset=\"x\",X" assert_equals: expected "text/plain;charset=x" but got ";charset=\"x\"" >-FAIL "data:;CHARSET=\"X\",X" assert_equals: expected "text/plain;charset=X" but got ";CHARSET=\"X\"" >+FAIL "data:;%62ase64,WA" assert_equals: expected "text/plain" but got "text/plain;%62ase64" >+PASS "data:%3Bbase64,WA" >+PASS "data:;charset=x,X" >+FAIL "data:; charset=x,X" assert_equals: expected "text/plain;charset=x" but got "text/plain; charset=x" >+FAIL "data:;charset =x,X" assert_equals: expected "text/plain" but got "text/plain;charset =x" >+FAIL "data:;charset= x,X" assert_equals: expected "text/plain;charset=\" x\"" but got "text/plain;charset= x" >+FAIL "data:;charset=,X" assert_equals: expected "text/plain" but got "text/plain;charset=" >+FAIL "data:;charset,X" assert_equals: expected "text/plain" but got "text/plain;charset" >+FAIL "data:;charset=\"x\",X" assert_equals: expected "text/plain;charset=x" but got "text/plain;charset=\"x\"" >+FAIL "data:;CHARSET=\"X\",X" assert_equals: expected "text/plain;charset=X" but got "text/plain;CHARSET=\"X\"" > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt >index 7de610dd51064cb2680f05e3e27fba7bba9045b4..a7543a35d21441f5473617e2dfff82b4b59edc6e 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-blob-expected.txt >@@ -18,7 +18,7 @@ FAIL 13) MIME types need to be parsed and serialized: text/html;charset='gbk ass > FAIL 14) MIME types need to be parsed and serialized: text/html;charset=gbk' assert_equals: expected "text/html;charset=gbk'" but got "text/html" > FAIL 15) MIME types need to be parsed and serialized: text/html;charset=';charset=GBK assert_equals: expected "text/html;charset='" but got "text/html" > FAIL 16) MIME types need to be parsed and serialized: text/html;test;charset=gbk assert_equals: expected "text/html;charset=gbk" but got "text/html" >-FAIL 17) MIME types need to be parsed and serialized: text/html;test=;charset=gbk assert_equals: expected "text/html;charset=gbk" but got "application/octet-stream" >+FAIL 17) MIME types need to be parsed and serialized: text/html;test=;charset=gbk assert_equals: expected "text/html;charset=gbk" but got "text/html" > FAIL 18) MIME types need to be parsed and serialized: text/html;';charset=gbk assert_equals: expected "text/html;charset=gbk" but got "text/html" > FAIL 19) MIME types need to be parsed and serialized: text/html;";charset=gbk assert_equals: expected "text/html;charset=gbk" but got "text/html" > FAIL 20) MIME types need to be parsed and serialized: text/html ; ; charset=gbk assert_equals: expected "text/html;charset=gbk" but got "text/html" >@@ -51,7 +51,7 @@ PASS 46) MIME types need to be parsed and serialized: > PASS 47) MIME types need to be parsed and serialized: / > PASS 48) MIME types need to be parsed and serialized: bogus > PASS 49) MIME types need to be parsed and serialized: bogus/ >-FAIL 50) MIME types need to be parsed and serialized: bogus/ assert_equals: expected "application/octet-stream" but got "bogus/" >+PASS 50) MIME types need to be parsed and serialized: bogus/ > PASS 51) MIME types need to be parsed and serialized: bogus/bogus/; > PASS 52) MIME types need to be parsed and serialized: </> > PASS 53) MIME types need to be parsed and serialized: (/)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 182325
:
356308
|
356310
|
356312
|
356314
|
356319
|
356335
|
356348
|
356359
|
356404
|
356504
|
356588
|
360026
|
360096
|
360101
|
360102
|
360104
|
360106
|
360239
|
360365
|
360367
|
360370
|
360499
|
361798
|
361806
|
361842