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

Unified Diff: third_party/WebKit/Source/web/WebPageSerializerImpl.cpp

Issue 1407663004: Tweaking WebPageSerializerImpl to emit a BOM for UTF16/32. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making .gitattributes more generic. Created 5 years 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/web/WebPageSerializerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp b/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
index 694c823537fd26515f275bd1652c7d9b25ae848e..0e743c1f27daed525d521924f587557d45e69ded 100644
--- a/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
@@ -156,11 +156,7 @@ String WebPageSerializerImpl::preActionBeforeSerializeOpenTag(
if (!param->haveAddedXMLProcessingDirective) {
param->haveAddedXMLProcessingDirective = true;
// Get encoding info.
- String xmlEncoding = param->document->xmlEncoding();
- if (xmlEncoding.isEmpty())
- xmlEncoding = param->document->encodingName();
- if (xmlEncoding.isEmpty())
- xmlEncoding = UTF8Encoding().name();
+ String xmlEncoding = param->textEncoding.name();
result.appendLiteral("<?xml version=\"");
result.append(param->document->xmlVersion());
result.appendLiteral("\" encoding=\"");
@@ -452,7 +448,7 @@ bool WebPageSerializerImpl::serialize()
if (url.isValid()) {
didSerialization = true;
- const WTF::TextEncoding& textEncoding = document->encoding().isValid() ? document->encoding() : UTF8Encoding();
+ const WTF::TextEncoding& textEncoding = UTF8Encoding();
SerializeDomParam param(url, textEncoding, document, m_localDirectoryName);
« no previous file with comments | « chrome/test/data/save_page/frames-encodings.htm ('k') | third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698