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

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

Issue 177763002: Fix serialization of (xlink:)href attributes in document fragments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use js-test framework. Created 6 years, 10 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-attribute-ns-prefix-expected.txt ('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 044e9ee3854ddeff91ec6e669ac94f926968841f..9ad5d09bec3f302c77833c2363d60223ccecd702 100644
--- a/Source/core/editing/MarkupAccumulator.cpp
+++ b/Source/core/editing/MarkupAccumulator.cpp
@@ -426,10 +426,10 @@ void MarkupAccumulator::appendAttribute(StringBuilder& result, const Element& el
result.append(' ');
- if (documentIsHTML && !attributeIsInSerializedNamespace(attribute))
+ QualifiedName prefixedName = attribute.name();
+ if (documentIsHTML && !attributeIsInSerializedNamespace(attribute)) {
result.append(attribute.name().localName());
- else {
- QualifiedName prefixedName = attribute.name();
+ } else {
if (attribute.namespaceURI() == XLinkNames::xlinkNamespaceURI) {
if (!attribute.prefix())
prefixedName.setPrefix(xlinkAtom);
@@ -445,16 +445,16 @@ void MarkupAccumulator::appendAttribute(StringBuilder& result, const Element& el
result.append('=');
- if (element.isURLAttribute(attribute))
+ if (element.isURLAttribute(attribute)) {
appendQuotedURLAttributeValue(result, element, attribute);
- else {
+ } else {
result.append('"');
appendAttributeValue(result, attribute.value(), documentIsHTML);
result.append('"');
}
if (!documentIsHTML && namespaces && shouldAddNamespaceAttribute(attribute, *namespaces))
- appendNamespace(result, attribute.prefix(), attribute.namespaceURI(), *namespaces);
+ appendNamespace(result, prefixedName.prefix(), prefixedName.namespaceURI(), *namespaces);
}
void MarkupAccumulator::appendCDATASection(StringBuilder& result, const String& section)
« no previous file with comments | « LayoutTests/fast/dom/XMLSerializer-attribute-ns-prefix-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698