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

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

Issue 69543007: Have NodeTraversal::nextSkippingChildren() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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/ReplaceSelectionCommand.cpp
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 3f6691d3d0ee2461759ecfebc3230e46b7fae6de..6e37a783a4e27f5e90122bb44a5fd90e15f36ef2 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -315,7 +315,7 @@ void ReplacementFragment::removeInterchangeNodes(Node* container)
while (node) {
RefPtr<Node> next = NodeTraversal::next(*node);
if (isInterchangeConvertedSpaceSpan(node)) {
- next = NodeTraversal::nextSkippingChildren(node);
+ next = NodeTraversal::nextSkippingChildren(*node);
removeNodePreservingChildren(node);
}
node = next.get();
@@ -335,7 +335,7 @@ inline void ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChil
if (m_firstNodeInserted == node)
m_firstNodeInserted = NodeTraversal::next(node);
if (m_lastNodeInserted == node)
- m_lastNodeInserted = node.lastChild() ? node.lastChild() : NodeTraversal::nextSkippingChildren(&node);
+ m_lastNodeInserted = node.lastChild() ? node.lastChild() : NodeTraversal::nextSkippingChildren(node);
}
inline void ReplaceSelectionCommand::InsertedNodes::willRemoveNode(Node& node)
@@ -343,10 +343,11 @@ inline void ReplaceSelectionCommand::InsertedNodes::willRemoveNode(Node& node)
if (m_firstNodeInserted == node && m_lastNodeInserted == node) {
m_firstNodeInserted = 0;
m_lastNodeInserted = 0;
- } else if (m_firstNodeInserted == node)
- m_firstNodeInserted = NodeTraversal::nextSkippingChildren(m_firstNodeInserted.get());
- else if (m_lastNodeInserted == node)
+ } else if (m_firstNodeInserted == node) {
+ m_firstNodeInserted = NodeTraversal::nextSkippingChildren(*m_firstNodeInserted);
+ } else if (m_lastNodeInserted == node) {
m_lastNodeInserted = NodeTraversal::previousSkippingChildren(m_lastNodeInserted.get());
+ }
}
inline void ReplaceSelectionCommand::InsertedNodes::didReplaceNode(Node& node, Node& newNode)
@@ -703,7 +704,7 @@ static void removeHeadContents(ReplacementFragment& fragment)
|| node->hasTagName(metaTag)
|| node->hasTagName(styleTag)
|| isHTMLTitleElement(node)) {
- next = NodeTraversal::nextSkippingChildren(node);
+ next = NodeTraversal::nextSkippingChildren(*node);
fragment.removeNode(node);
} else {
next = NodeTraversal::next(*node);

Powered by Google App Engine
This is Rietveld 408576698