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

Unified Diff: Source/core/editing/MarkupAccumulator.cpp

Issue 183663033: Pre-bind the 'xml' prefix for serialization of XML fragments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « LayoutTests/fast/dom/XMLSerializer-prebound-xml-prefix.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « LayoutTests/fast/dom/XMLSerializer-prebound-xml-prefix.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698