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

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

Issue 182383012: Have positionInParentBeforeNode() / positionInParentAfterNode() take a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 | « Source/core/editing/CreateLinkCommand.cpp ('k') | Source/core/editing/FormatBlockCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/DeleteSelectionCommand.cpp
diff --git a/Source/core/editing/DeleteSelectionCommand.cpp b/Source/core/editing/DeleteSelectionCommand.cpp
index 11497c21b2e2558f0971e0601574d65d777dceb1..459fe2f2c787627401d15fe302a421b8dfab9a4e 100644
--- a/Source/core/editing/DeleteSelectionCommand.cpp
+++ b/Source/core/editing/DeleteSelectionCommand.cpp
@@ -134,11 +134,11 @@ void DeleteSelectionCommand::initializeStartEnd(Position& start, Position& end)
break;
// If we're going to expand to include the startSpecialContainer, it must be fully selected.
- if (startSpecialContainer && !endSpecialContainer && comparePositions(positionInParentAfterNode(startSpecialContainer), end) > -1)
+ if (startSpecialContainer && !endSpecialContainer && comparePositions(positionInParentAfterNode(*startSpecialContainer), end) > -1)
break;
// If we're going to expand to include the endSpecialContainer, it must be fully selected.
- if (endSpecialContainer && !startSpecialContainer && comparePositions(start, positionInParentBeforeNode(endSpecialContainer)) > -1)
+ if (endSpecialContainer && !startSpecialContainer && comparePositions(start, positionInParentBeforeNode(*endSpecialContainer)) > -1)
break;
if (startSpecialContainer && startSpecialContainer->isDescendantOf(endSpecialContainer))
@@ -386,9 +386,9 @@ void DeleteSelectionCommand::removeNode(PassRefPtr<Node> node, ShouldAssumeConte
m_needPlaceholder = true;
// FIXME: Update the endpoints of the range being deleted.
- updatePositionForNodeRemoval(m_endingPosition, node.get());
- updatePositionForNodeRemoval(m_leadingWhitespace, node.get());
- updatePositionForNodeRemoval(m_trailingWhitespace, node.get());
+ updatePositionForNodeRemoval(m_endingPosition, *node);
+ updatePositionForNodeRemoval(m_leadingWhitespace, *node);
+ updatePositionForNodeRemoval(m_trailingWhitespace, *node);
CompositeEditCommand::removeNode(node, shouldAssumeContentIsAlwaysEditable);
}
@@ -511,7 +511,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
RefPtr<Node> nextNode = NodeTraversal::nextSkippingChildren(*node);
// if we just removed a node from the end container, update end position so the
// check above will work
- updatePositionForNodeRemoval(m_downstreamEnd, node.get());
+ updatePositionForNodeRemoval(m_downstreamEnd, *node);
removeNode(node.get());
node = nextNode.get();
} else {
@@ -755,7 +755,7 @@ void DeleteSelectionCommand::removeRedundantBlocks()
while (node != rootNode) {
if (isRemovableBlock(node)) {
if (node == m_endingPosition.anchorNode())
- updatePositionForNodeRemovalPreservingChildren(m_endingPosition, node);
+ updatePositionForNodeRemovalPreservingChildren(m_endingPosition, *node);
CompositeEditCommand::removeNodePreservingChildren(node);
node = m_endingPosition.anchorNode();
« no previous file with comments | « Source/core/editing/CreateLinkCommand.cpp ('k') | Source/core/editing/FormatBlockCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698