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

Unified Diff: Source/core/editing/commands/CompositeEditCommand.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/CompositeEditCommand.cpp
diff --git a/Source/core/editing/commands/CompositeEditCommand.cpp b/Source/core/editing/commands/CompositeEditCommand.cpp
index 652249ec174487f719acdc81943d44c83a879bdc..d6d043c2399f5f453e0933c1890e67ac64d669e3 100644
--- a/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -838,7 +838,7 @@ void CompositeEditCommand::deleteInsignificantText(const Position& start, const
void CompositeEditCommand::deleteInsignificantTextDownstream(const Position& pos)
{
- Position end = mostForwardCaretPosition(VisiblePosition(pos, VP_DEFAULT_AFFINITY).next().deepEquivalent());
+ Position end = mostForwardCaretPosition(nextPositionOf(VisiblePosition(pos, VP_DEFAULT_AFFINITY)).deepEquivalent());
deleteInsignificantText(pos, end);
}
@@ -923,7 +923,7 @@ PassRefPtrWillBeRawPtr<HTMLElement> CompositeEditCommand::moveParagraphContentsT
VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY);
VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos));
VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePos);
- VisiblePosition next = visibleParagraphEnd.next();
+ VisiblePosition next = nextPositionOf(visibleParagraphEnd);
VisiblePosition visibleEnd = next.isNotNull() ? next : visibleParagraphEnd;
Position upstreamStart = mostBackwardCaretPosition(visibleParagraphStart.deepEquivalent());
@@ -1131,7 +1131,7 @@ void CompositeEditCommand::moveParagraphWithClones(const VisiblePosition& startO
ASSERT(blockElement);
VisiblePosition beforeParagraph = previousPositionOf(startOfParagraphToMove);
- VisiblePosition afterParagraph(endOfParagraphToMove.next());
+ VisiblePosition afterParagraph(nextPositionOf(endOfParagraphToMove));
// We upstream() the end and downstream() the start so that we don't include collapsed whitespace in the move.
// When we paste a fragment, spaces after the end and before the start are treated as though they were rendered.
@@ -1206,7 +1206,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
}
VisiblePosition beforeParagraph = previousPositionOf(startOfParagraphToMove, CannotCrossEditingBoundary);
- VisiblePosition afterParagraph(endOfParagraphToMove.next(CannotCrossEditingBoundary));
+ VisiblePosition afterParagraph(nextPositionOf(endOfParagraphToMove, CannotCrossEditingBoundary));
// We upstream() the end and downstream() the start so that we don't include collapsed whitespace in the move.
// When we paste a fragment, spaces after the end and before the start are treated as though they were rendered.
« no previous file with comments | « Source/core/editing/commands/BreakBlockquoteCommand.cpp ('k') | Source/core/editing/commands/DeleteSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698