| Index: third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp
|
| diff --git a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp
|
| index 9d3c5de1b0bce672613430fb3c281c770ea0064b..e4b84334b3246d66ebe79a1f89ac7c8442313951 100644
|
| --- a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp
|
| @@ -101,13 +101,15 @@ TextResourceDecoderBuilder::createDecoderInstance(Document* document) {
|
| getEncodingFromDomain(document->url());
|
| if (LocalFrame* frame = document->frame()) {
|
| if (Settings* settings = frame->settings()) {
|
| + const WTF::TextEncoding hintEncoding =
|
| + encodingFromDomain.isValid() ? encodingFromDomain
|
| + : settings->getDefaultTextEncodingName();
|
| // Disable autodetection for XML to honor the default encoding (UTF-8) for
|
| // unlabelled documents.
|
| - return TextResourceDecoder::create(
|
| - m_mimeType,
|
| - encodingFromDomain.isValid() ? encodingFromDomain
|
| - : settings->getDefaultTextEncodingName(),
|
| - !DOMImplementation::isXMLMIMEType(m_mimeType));
|
| + if (DOMImplementation::isXMLMIMEType(m_mimeType))
|
| + return TextResourceDecoder::create(m_mimeType, hintEncoding);
|
| + return TextResourceDecoder::createWithAutoDetection(
|
| + m_mimeType, hintEncoding, document->url());
|
| }
|
| }
|
|
|
|
|