From d3dfdf0c699d139967276905a1134467bdfff9d6 Mon Sep 17 00:00:00 2001 From: "carlosgc@webkit.org" Date: Wed, 19 Sep 2018 13:19:07 +0000 Subject: [PATCH] Merge r235844 - XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header https://bugs.webkit.org/show_bug.cgi?id=189465 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Rob Buis on 2018-09-10 Reviewed by Frédéric Wang. LayoutTests/imported/w3c: * web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt: Source/WebCore: The xhr spec changed [1, 2] so that overrideMimeType should not update the response's "Content-Type" header anymore. Behavior matches Firefox and Chrome. [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype [2] https://github.com/whatwg/xhr/issues/157 Tests: http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveResponse): LayoutTests: Change existing test to reflect new behavior. * http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt: * http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html: git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.22@236185 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 12 +++++++++++ ...emimetype-content-type-header-expected.txt | 4 ++-- ...-overridemimetype-content-type-header.html | 4 ++-- LayoutTests/imported/w3c/ChangeLog | 9 ++++++++ ...idemimetype-invalid-mime-type-expected.txt | 4 ++-- Source/WebCore/ChangeLog | 21 +++++++++++++++++++ Source/WebCore/xml/XMLHttpRequest.cpp | 3 --- 7 files changed, 48 insertions(+), 9 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 90aeaae789912..39b3b01499446 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,15 @@ +2018-09-10 Rob Buis + + XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header + https://bugs.webkit.org/show_bug.cgi?id=189465 + + Reviewed by Frédéric Wang. + + Change existing test to reflect new behavior. + + * http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt: + * http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html: + 2018-09-10 Antoine Quint [Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails diff --git a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt index 0fbe1e8843226..880b205f89c2b 100644 --- a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt +++ b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt @@ -1,9 +1,9 @@ -This tests that XMLHttpRequest overrideMimeType() properly updates the Content-Type header for the response. +This tests that XMLHttpRequest overrideMimeType() does not update the Content-Type header for the response. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS xhr.getResponseHeader("Content-Type") is "text/xml;charset=GBK" +PASS xhr.getResponseHeader("Content-Type") is "application/xml" PASS successfullyParsed is true TEST COMPLETE diff --git a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html index 9c2b96883cfbc..04add7a5d82b7 100644 --- a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html +++ b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html @@ -5,7 +5,7 @@