WebKit Bugzilla
Attachment 360355 Details for
Bug 180526
: Update MIME type parser
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-180526-20190128193318.patch (text/plain), 6.30 KB, created by
Rob Buis
on 2019-01-28 10:33:19 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2019-01-28 10:33:19 PST
Size:
6.30 KB
patch
obsolete
>Subversion Revision: 240582 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a07bfdf571ecb965440eb62e5b2faf65b9b5123a..3c3d2a59208eae3720f5ac3674c2ba462037fc0e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2019-01-28 Rob Buis <rbuis@igalia.com> >+ >+ Update MIME type parser >+ https://bugs.webkit.org/show_bug.cgi?id=180526 >+ >+ Reviewed by Frédéric Wang. >+ >+ I overlooked step 11.9.3 [1], for Mimesniff we should not >+ bail out on missing subtype, but keep trying. Note >+ that Rfc2045 does require bailing out, as before. >+ >+ Test: ParsedContentType unittest >+ >+ [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type >+ >+ * platform/network/ParsedContentType.cpp: >+ (WebCore::parseToken): >+ (WebCore::parseContentType): >+ > 2019-01-28 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition >diff --git a/Source/WebCore/platform/network/ParsedContentType.cpp b/Source/WebCore/platform/network/ParsedContentType.cpp >index e3eabd99903c69b2149f09fa03d09b4b5bcc9f2e..67a433ce575a5925f87893e5317a2038a65ca77f 100644 >--- a/Source/WebCore/platform/network/ParsedContentType.cpp >+++ b/Source/WebCore/platform/network/ParsedContentType.cpp >@@ -264,6 +264,8 @@ 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; > } >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 7f994b58c3f8462ae6237f1f0b977cdab2a01608..51ff1c85429ef389764ce33e563facd0ddc4bf00 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-28 Rob Buis <rbuis@igalia.com> >+ >+ Update MIME type parser >+ https://bugs.webkit.org/show_bug.cgi?id=180526 >+ >+ Reviewed by Frédéric Wang. >+ >+ * TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp: >+ (TestWebKitAPI::TEST): >+ > 2018-12-15 Darin Adler <darin@apple.com> > > Replace many uses of String::format with more type-safe alternatives >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp b/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp >index 45b88946af76a26dca5959d311da45ad4678cec6..155704ad0a233ae4add7334148c5af2007568e4e 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp >@@ -51,7 +51,8 @@ TEST(ParsedContentType, MimeSniff) > > 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=", Mode::MimeSniff)); >+ EXPECT_TRUE(isValidContentType("text/plain;test=;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)); >@@ -84,6 +85,7 @@ TEST(ParsedContentType, Rfc2045) > 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_FALSE(isValidContentType("text/plain;test=;test=value", 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)); >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index ec057412ce368bd74036ff1436c6a5caf449c7af..ce1f200ddf86f5418a73db27368d54be5fea6028 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-28 Rob Buis <rbuis@igalia.com> >+ >+ Update MIME type parser >+ https://bugs.webkit.org/show_bug.cgi?id=180526 >+ >+ Reviewed by Frédéric Wang. >+ >+ Update improved test expectations. >+ >+ * web-platform-tests/xhr/overridemimetype-blob-expected.txt: >+ > 2019-01-24 Charles Vazac <cvazac@akamai.com> > > Implement PerformanceObserver.supportedEntryTypes >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..b84b5e871c6ed96575914d1df6b2344696c3f394 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"
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 180526
:
348014
|
356923
|
356928
|
357400
|
357401
|
357403
|
357443
|
357469
|
357682
|
357684
|
357687
|
357690
|
357691
|
357702
|
358515
|
358898
|
358906
|
358907
|
358917
|
359860
|
360118
|
360123
|
360129
|
360134
|
360136
|
360144
|
360303
|
360343
|
360350
|
360355
|
362245
|
362316
|
362323
|
362342
|
362348
|
362360
|
362378
|
362384
|
362387
|
362390
|
362397
|
362416
|
362418
|
362430
|
362437
|
362483
|
362486
|
362497
|
362506
|
362526
|
390349