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

Unified Diff: Source/WebCore/editing/ReplaceSelectionCommand.cpp

Issue 10536125: Merge 119870 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 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 | « Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/editing/ReplaceSelectionCommand.cpp
===================================================================
--- Source/WebCore/editing/ReplaceSelectionCommand.cpp (revision 120113)
+++ Source/WebCore/editing/ReplaceSelectionCommand.cpp (working copy)
@@ -81,7 +81,7 @@
bool hasInterchangeNewlineAtEnd() const { return m_hasInterchangeNewlineAtEnd; }
void removeNode(PassRefPtr<Node>);
- void removeNodePreservingChildren(Node*);
+ void removeNodePreservingChildren(PassRefPtr<Node>);
private:
PassRefPtr<StyledElement> insertFragmentForTestRendering(Node* rootEditableNode);
@@ -211,14 +211,14 @@
return m_fragment ? m_fragment->lastChild() : 0;
}
-void ReplacementFragment::removeNodePreservingChildren(Node *node)
+void ReplacementFragment::removeNodePreservingChildren(PassRefPtr<Node> node)
{
if (!node)
return;
while (RefPtr<Node> n = node->firstChild()) {
removeNode(n);
- insertNodeBefore(n.release(), node);
+ insertNodeBefore(n.release(), node.get());
}
removeNode(node);
}
@@ -329,18 +329,12 @@
node = container->firstChild();
while (node) {
- Node *next = node->traverseNextNode();
+ RefPtr<Node> next = node->traverseNextNode();
if (isInterchangeConvertedSpaceSpan(node)) {
- RefPtr<Node> n = 0;
- while ((n = node->firstChild())) {
- removeNode(n);
- insertNodeBefore(n, node);
- }
- removeNode(node);
- if (n)
- next = n->traverseNextNode();
+ next = node->traverseNextSibling();
+ removeNodePreservingChildren(node);
}
- node = next;
+ node = next.get();
}
}
« no previous file with comments | « Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698