XMLHttpRequest has the wrong fallback encoding
https://bugs.webkit.org/show_bug.cgi?id=191741
Patch by Rob Buis <rbuis@igalia.com> on 2019-04-17
Reviewed by Alex Christensen.
LayoutTests/imported/w3c:
Update improved test expectations and sync unsupported-encodings.any.js and
replacement-encodings.any.js tests.
* web-platform-tests/encoding/replacement-encodings.any-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings-expected.txt.
* web-platform-tests/encoding/replacement-encodings.any.html: Added.
* web-platform-tests/encoding/replacement-encodings.any.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings.html.
* web-platform-tests/encoding/replacement-encodings.any.worker-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings-expected.txt.
* web-platform-tests/encoding/replacement-encodings.any.worker.html: Added.
* web-platform-tests/encoding/unsupported-encodings-expected.txt: Removed.
* web-platform-tests/encoding/unsupported-encodings.any-expected.txt: Added.
* web-platform-tests/encoding/unsupported-encodings.any.html: Added.
* web-platform-tests/encoding/unsupported-encodings.any.js: Added.
* web-platform-tests/encoding/unsupported-encodings.any.worker-expected.txt: Added.
* web-platform-tests/encoding/unsupported-encodings.any.worker.html: Added.
* web-platform-tests/encoding/unsupported-encodings.html: Removed.
* web-platform-tests/xhr/overridemimetype-edge-cases.window-expected.txt:
* web-platform-tests/xhr/responsetext-decoding-expected.txt:
Source/WebCore:
Allow overriding the response charset as specified here:
https://xhr.spec.whatwg.org/#final-charset
Behavior matches Firefox and Chrome.
Tests: imported/w3c/web-platform-tests/encoding/replacement-encodings.any.html
imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker.html
imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.html
imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.worker.html
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::finalResponseCharset const):
(WebCore::XMLHttpRequest::createDecoder const):
* xml/XMLHttpRequest.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244377
268f45cc-cd09-0410-ab3c-
d52691b4dbfc