Title: [235844] trunk
- Revision
- 235844
- Author
- [email protected]
- Date
- 2018-09-10 01:28:02 -0700 (Mon, 10 Sep 2018)
Log Message
XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header
https://bugs.webkit.org/show_bug.cgi?id=189465
Patch by Rob Buis <[email protected]> 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:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (235843 => 235844)
--- trunk/LayoutTests/ChangeLog 2018-09-10 07:13:19 UTC (rev 235843)
+++ trunk/LayoutTests/ChangeLog 2018-09-10 08:28:02 UTC (rev 235844)
@@ -1,3 +1,15 @@
+2018-09-10 Rob Buis <[email protected]>
+
+ 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 <[email protected]>
[Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt (235843 => 235844)
--- trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt 2018-09-10 07:13:19 UTC (rev 235843)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt 2018-09-10 08:28:02 UTC (rev 235844)
@@ -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
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html (235843 => 235844)
--- trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html 2018-09-10 07:13:19 UTC (rev 235843)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html 2018-09-10 08:28:02 UTC (rev 235844)
@@ -5,7 +5,7 @@
</head>
<body>
<script>
- description('This tests that XMLHttpRequest overrideMimeType() properly updates the Content-Type header for the response.');
+ description('This tests that XMLHttpRequest overrideMimeType() does not update the Content-Type header for the response.');
window.jsTestIsAsync = true;
var xhr = new XMLHttpRequest();
@@ -13,7 +13,7 @@
xhr._onreadystatechange_ = function () {
if (xhr.readyState == xhr.LOADING) {
- shouldBe('xhr.getResponseHeader("Content-Type")', '"text/xml;charset=GBK"');
+ shouldBe('xhr.getResponseHeader("Content-Type")', '"application/xml"');
finishJSTest();
}
}
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235843 => 235844)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-09-10 07:13:19 UTC (rev 235843)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-09-10 08:28:02 UTC (rev 235844)
@@ -1,3 +1,12 @@
+2018-09-10 Rob Buis <[email protected]>
+
+ 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.
+
+ * web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt:
+
2018-09-07 Youenn Fablet <[email protected]>
Add support for unified plan transceivers
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt (235843 => 235844)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt 2018-09-10 07:13:19 UTC (rev 235843)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt 2018-09-10 08:28:02 UTC (rev 235844)
@@ -1,5 +1,5 @@
-FAIL Bogus MIME type does not override encoding assert_equals: expected "text/html;charset=windows-1252" but got "bogus"
+PASS Bogus MIME type does not override encoding
FAIL Bogus MIME type does not override encoding, 2 assert_equals: expected "ÿ" but got "\x1a"
-FAIL Bogus MIME type does override MIME type assert_equals: expected "text/xml" but got "bogus"
+PASS Bogus MIME type does override MIME type
Modified: trunk/Source/WebCore/ChangeLog (235843 => 235844)
--- trunk/Source/WebCore/ChangeLog 2018-09-10 07:13:19 UTC (rev 235843)
+++ trunk/Source/WebCore/ChangeLog 2018-09-10 08:28:02 UTC (rev 235844)
@@ -1,3 +1,24 @@
+2018-09-10 Rob Buis <[email protected]>
+
+ 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.
+
+ 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):
+
2018-09-10 Antoine Quint <[email protected]>
[Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails
Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (235843 => 235844)
--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2018-09-10 07:13:19 UTC (rev 235843)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2018-09-10 08:28:02 UTC (rev 235844)
@@ -965,8 +965,6 @@
void XMLHttpRequest::didReceiveResponse(unsigned long, const ResourceResponse& response)
{
m_response = response;
- if (!m_mimeTypeOverride.isEmpty())
- m_response.setHTTPHeaderField(HTTPHeaderName::ContentType, m_mimeTypeOverride);
}
static inline bool shouldDecodeResponse(XMLHttpRequest::ResponseType type)
@@ -1026,7 +1024,6 @@
if (readyState() < HEADERS_RECEIVED)
changeState(HEADERS_RECEIVED);
- // FIXME: Should we update "Content-Type" header field with m_mimeTypeOverride value in case it has changed since didReceiveResponse?
if (!m_mimeTypeOverride.isEmpty())
m_responseEncoding = extractCharsetFromMediaType(m_mimeTypeOverride);
if (m_responseEncoding.isEmpty())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes