Index: Source/core/editing/MarkupAccumulator.cpp |
diff --git a/Source/core/editing/MarkupAccumulator.cpp b/Source/core/editing/MarkupAccumulator.cpp |
index 8be6e8a1722c1264be70af5c7f672e29f3ff3306..7fbd2e9372152423523568558721b30274a2a51f 100644 |
--- a/Source/core/editing/MarkupAccumulator.cpp |
+++ b/Source/core/editing/MarkupAccumulator.cpp |
@@ -109,7 +109,15 @@ MarkupAccumulator::~MarkupAccumulator() |
String MarkupAccumulator::serializeNodes(Node& targetNode, EChildrenOnly childrenOnly, Vector<QualifiedName>* tagNamesToSkip) |
{ |
- serializeNodesWithNamespaces(targetNode, childrenOnly, 0, tagNamesToSkip); |
+ Namespaces* namespaces = 0; |
+ Namespaces namespaceHash; |
+ if (!targetNode.document().isHTMLDocument()) { |
+ // Add pre-bound namespaces for XML fragments. |
+ namespaceHash.set(xmlAtom.impl(), XMLNames::xmlNamespaceURI.impl()); |
+ namespaces = &namespaceHash; |
+ } |
+ |
+ serializeNodesWithNamespaces(targetNode, childrenOnly, namespaces, tagNamesToSkip); |
return m_markup.toString(); |
} |