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

Unified Diff: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp

Issue 2691913002: Introduce computePositionForNodeRemoval() as replacement of updatePositionForNodeRemoval() (Closed)
Patch Set: 2017-02-24T16:31:47 Created 3 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
Index: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
index 074bb7a715aab966d6f61c8fa4bbe1f15bc7aa47..cb59bcd592de2af76f90e967c1fe13a58baa7d8e 100644
--- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
@@ -517,9 +517,11 @@ void DeleteSelectionCommand::removeNode(
}
// FIXME: Update the endpoints of the range being deleted.
- updatePositionForNodeRemoval(m_endingPosition, *node);
- updatePositionForNodeRemoval(m_leadingWhitespace, *node);
- updatePositionForNodeRemoval(m_trailingWhitespace, *node);
+ m_endingPosition = computePositionForNodeRemoval(m_endingPosition, *node);
+ m_leadingWhitespace =
+ computePositionForNodeRemoval(m_leadingWhitespace, *node);
+ m_trailingWhitespace =
+ computePositionForNodeRemoval(m_trailingWhitespace, *node);
CompositeEditCommand::removeNode(node, editingState,
shouldAssumeContentIsAlwaysEditable);
@@ -671,7 +673,7 @@ void DeleteSelectionCommand::handleGeneralDelete(EditingState* editingState) {
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);
+ m_downstreamEnd = computePositionForNodeRemoval(m_downstreamEnd, *node);
removeNode(node, editingState);
if (editingState->isAborted())
return;

Powered by Google App Engine
This is Rietveld 408576698