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

Unified Diff: Source/core/editing/commands/TypingCommand.cpp

Issue 1307803003: Introduce nextPositionOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T18:13:02 Created 5 years, 4 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: Source/core/editing/commands/TypingCommand.cpp
diff --git a/Source/core/editing/commands/TypingCommand.cpp b/Source/core/editing/commands/TypingCommand.cpp
index 5ac739a5374e94a5fc7c90b476b0e637eae8e747..3da0121ac8a986734c2c9a09fd32519c58b3d7be 100644
--- a/Source/core/editing/commands/TypingCommand.cpp
+++ b/Source/core/editing/commands/TypingCommand.cpp
@@ -445,7 +445,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
return;
}
// When there are no visible positions in the editing root, delete its entire contents.
- if (visibleStart.next(CannotCrossEditingBoundary).isNull() && makeEditableRootEmpty()) {
+ if (nextPositionOf(visibleStart, CannotCrossEditingBoundary).isNull() && makeEditableRootEmpty()) {
typingAddedToOpenCommand(DeleteKey);
return;
}
@@ -546,7 +546,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
if (enclosingTableCell && visibleEnd.deepEquivalent() == VisiblePosition(lastPositionInNode(enclosingTableCell)).deepEquivalent())
return;
if (visibleEnd.deepEquivalent() == endOfParagraph(visibleEnd).deepEquivalent())
- downstreamEnd = mostForwardCaretPosition(visibleEnd.next(CannotCrossEditingBoundary).deepEquivalent());
+ downstreamEnd = mostForwardCaretPosition(nextPositionOf(visibleEnd, CannotCrossEditingBoundary).deepEquivalent());
// When deleting tables: Select the table first, then perform the deletion
if (isRenderedTableElement(downstreamEnd.computeContainerNode()) && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(downstreamEnd.computeContainerNode())) {
setEndingSelection(VisibleSelection(endingSelection().end(), positionAfterNode(downstreamEnd.computeContainerNode()), TextAffinity::Downstream, endingSelection().isDirectional()));
« no previous file with comments | « Source/core/editing/commands/ReplaceSelectionCommand.cpp ('k') | Source/core/editing/serializers/StyledMarkupSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698