Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp |
| index 6c97585b46d66485714cb03b9010c6ab26300ead..6b89e4a31499181979ba1e2ceac1982435e9452c 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp |
| @@ -137,8 +137,13 @@ void TextResourceDecoder::setEncoding(const WTF::TextEncoding& encoding, Encodin |
| if (!encoding.isValid()) |
| return; |
| + // Default encoding for XML content should remain as UTF-8 even if the autodetection comes into play |
|
Jinsuk Kim
2016/09/05 10:08:50
This change was made to make following XML tests p
tkent
2016/09/05 23:53:45
Why did they fail? Did the other part of this CL
|
| + // to detect it as Latin-1. |
| + if (m_contentType == XMLContent && source == EncodingFromContentSniffing && encoding == Latin1Encoding()) |
| + return; |
| + |
| // When encoding comes from meta tag (i.e. it cannot be XML files sent via XHR), |
| - // treat x-user-defined as windows-1252 (bug 18270) |
| + // treat x-user-defined as windows-1252 (bug 18270). |
| if (source == EncodingFromMetaTag && !strcasecmp(encoding.name(), "x-user-defined")) |
| m_encoding = "windows-1252"; |
| else if (source == EncodingFromMetaTag || source == EncodingFromXMLHeader || source == EncodingFromCSSCharset) |