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

Unified Diff: Source/core/page/PageSerializer.cpp

Issue 22926011: Add doctype declarations when using PageSerializer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 7 years, 4 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
« no previous file with comments | « no previous file | Source/web/tests/PageSerializerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageSerializer.cpp
diff --git a/Source/core/page/PageSerializer.cpp b/Source/core/page/PageSerializer.cpp
index 7c61b3963d51d06bad3ee806676ddbc78215874f..2005a65ae7df45cb0bf933950dfea0897603668d 100644
--- a/Source/core/page/PageSerializer.cpp
+++ b/Source/core/page/PageSerializer.cpp
@@ -115,9 +115,6 @@ SerializerMarkupAccumulator::SerializerMarkupAccumulator(PageSerializer* seriali
, m_serializer(serializer)
, m_document(document)
{
- // MarkupAccumulator does not serialize the <?xml ... line, so we add it explicitely to ensure the right encoding is specified.
- if (m_document->isXHTMLDocument() || m_document->xmlStandalone() || m_document->isSVGDocument())
- appendString("<?xml version=\"" + m_document->xmlVersion() + "\" encoding=\"" + m_document->charset() + "\"?>");
}
SerializerMarkupAccumulator::~SerializerMarkupAccumulator()
@@ -205,7 +202,7 @@ void PageSerializer::serializeFrame(Frame* frame)
// FIXME: iframes used as images trigger this. We should deal with them correctly.
return;
}
- String text = accumulator.serializeNodes(document->documentElement(), IncludeNode);
+ String text = accumulator.serializeNodes(document, IncludeNode);
CString frameHTML = textEncoding.normalizeAndEncode(text, WTF::EntitiesForUnencodables);
m_resources->append(SerializedResource(url, document->suggestedMIMEType(), SharedBuffer::create(frameHTML.data(), frameHTML.length())));
m_resourceURLs.add(url);
« no previous file with comments | « no previous file | Source/web/tests/PageSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698