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

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

Issue 426293002: Use tighter typing in editing: MarkupAccumulator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
Index: Source/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index de075c6286511c3c46a1e6987fa3dee1b5e5df46..a31440ce4786beaf62b89ea6c77bfff87f33d44c 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -181,7 +181,8 @@ void StyledMarkupAccumulator::wrapWithNode(ContainerNode& node, bool convertBloc
else
appendStartMarkup(markup, node, 0);
m_reversedPrecedingMarkup.append(markup.toString());
- appendEndTag(node);
+ if (node.isElementNode())
+ appendEndTag(toElement(node));
if (m_nodes)
m_nodes->append(&node);
}
@@ -402,8 +403,8 @@ Node* StyledMarkupAccumulator::traverseNodesForSerialization(Node* startNode, No
openedTag = true;
ancestorsToClose.append(toContainerNode(n));
} else {
- if (shouldEmit)
- appendEndTag(*n);
+ if (shouldEmit && n->isElementNode())
+ appendEndTag(toElement(*n));
lastClosed = n;
}
}
@@ -418,8 +419,8 @@ Node* StyledMarkupAccumulator::traverseNodesForSerialization(Node* startNode, No
if (next != pastEnd && next->isDescendantOf(ancestor))
break;
// Not at the end of the range, close ancestors up to sibling of next node.
- if (shouldEmit)
- appendEndTag(*ancestor);
+ if (shouldEmit && ancestor->isElementNode())
+ appendEndTag(toElement(*ancestor));
lastClosed = ancestor;
ancestorsToClose.removeLast();
}

Powered by Google App Engine
This is Rietveld 408576698