Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Unified Diff: third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp

Issue 2293373002: Remove unused prefs/api/resource for setPageEncoding (Closed)
Patch Set: removed unused flag/prefs Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698