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

Unified Diff: Source/core/dom/NodeIterator.cpp

Issue 69003004: Have NodeTraversal::previous*() 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
« no previous file with comments | « Source/core/dom/ElementTraversal.h ('k') | Source/core/dom/NodeTraversal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeIterator.cpp
diff --git a/Source/core/dom/NodeIterator.cpp b/Source/core/dom/NodeIterator.cpp
index 348df6955d3243569c24f20f4e1b3ec9a90bd59d..66cf2b683eb0bd69bcdab0b51af8023b0e896dd0 100644
--- a/Source/core/dom/NodeIterator.cpp
+++ b/Source/core/dom/NodeIterator.cpp
@@ -70,7 +70,7 @@ bool NodeIterator::NodePointer::moveToPrevious(Node* root)
isPointerBeforeNode = true;
return true;
}
- node = NodeTraversal::previous(node.get(), root);
+ node = NodeTraversal::previous(*node, root);
return node;
}
@@ -183,13 +183,13 @@ void NodeIterator::updateForNodeRemoval(Node& removedNode, NodePointer& referenc
if (node)
referenceNode.node = node;
} else {
- node = NodeTraversal::previous(&removedNode, root());
+ node = NodeTraversal::previous(removedNode, root());
if (node) {
// Move out from under the node being removed if the reference node is
// a descendant of the node being removed.
if (willRemoveReferenceNodeAncestor) {
while (node && node->isDescendantOf(&removedNode))
- node = NodeTraversal::previous(node, root());
+ node = NodeTraversal::previous(*node, root());
}
if (node) {
// Removing last node.
@@ -201,13 +201,13 @@ void NodeIterator::updateForNodeRemoval(Node& removedNode, NodePointer& referenc
}
}
} else {
- Node* node = NodeTraversal::previous(&removedNode, root());
+ Node* node = NodeTraversal::previous(removedNode, root());
if (node) {
// Move out from under the node being removed if the reference node is
// a descendant of the node being removed.
if (willRemoveReferenceNodeAncestor) {
while (node && node->isDescendantOf(&removedNode))
- node = NodeTraversal::previous(node, root());
+ node = NodeTraversal::previous(*node, root());
}
if (node)
referenceNode.node = node;
@@ -218,7 +218,7 @@ void NodeIterator::updateForNodeRemoval(Node& removedNode, NodePointer& referenc
// a descendant of the node being removed.
if (willRemoveReferenceNodeAncestor) {
while (node && node->isDescendantOf(&removedNode))
- node = NodeTraversal::previous(node, root());
+ node = NodeTraversal::previous(*node, root());
}
if (node)
referenceNode.node = node;
« no previous file with comments | « Source/core/dom/ElementTraversal.h ('k') | Source/core/dom/NodeTraversal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698