[Fetch] Always use utf-8 for decoding in text()
In the spec, Response.text() should run utf-8 decode , i.e. always use
utf-8. But in the implementation, TextResourceDecoder used by Response.text()
decodes the input as utf-16/32 if it contains utf-16/32 BOMs.
- Adds TextResourceDecoder::createAlwaysUseUTF8ForText() and
AlwaysUseUTF8ForText that corresponds to utf-8 decode in the spec .
- Fixes Response.text() by using CheckForOnlyUTF8BOM in FetchDataLoaderAsString.
- Adds layout tests for Fetch API and XHRs
(but doesn't change the behavior of XHRs).
Review URL: https://codereview.chromium.org/1470893002
12 files changed