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

Unified Diff: Source/core/editing/VisibleSelection.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
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 0be32836a8066f3fa3cf1fd2df20a140f410e2a7..b390fd5710b416fdc0b46e0b900357a0b0222b7b 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -479,13 +479,13 @@ void VisibleSelection::setEndRespectingGranularity(TextGranularity granularity,
if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.anchorNode())) {
// Select the paragraph break (the space from the end of a paragraph to the start of
// the next one) to match TextEdit.
- end = wordEnd.next();
+ end = nextPositionOf(wordEnd);
if (Element* table = isFirstPositionAfterTable(end)) {
// The paragraph break after the last paragraph in the last cell of a block table ends
// at the start of the paragraph after the table.
if (isEnclosingBlock(table))
- end = end.next(CannotCrossEditingBoundary);
+ end = nextPositionOf(end, CannotCrossEditingBoundary);
else
end = wordEnd;
}
@@ -507,7 +507,7 @@ void VisibleSelection::setEndRespectingGranularity(TextGranularity granularity,
// If the end of this line is at the end of a paragraph, include the space
// after the end of the line in the selection.
if (isEndOfParagraph(end)) {
- VisiblePosition next = end.next();
+ VisiblePosition next = nextPositionOf(end);
if (next.isNotNull())
end = next;
}
@@ -522,13 +522,13 @@ void VisibleSelection::setEndRespectingGranularity(TextGranularity granularity,
// Include the "paragraph break" (the space from the end of this paragraph to the start
// of the next one) in the selection.
- VisiblePosition end(visibleParagraphEnd.next());
+ VisiblePosition end(nextPositionOf(visibleParagraphEnd));
if (Element* table = isFirstPositionAfterTable(end)) {
// The paragraph break after the last paragraph in the last cell of a block table ends
// at the start of the paragraph after the table, not at the position just after the table.
if (isEnclosingBlock(table))
- end = end.next(CannotCrossEditingBoundary);
+ end = nextPositionOf(end, CannotCrossEditingBoundary);
// There is no parargraph break after the last paragraph in the last cell of an inline table.
else
end = visibleParagraphEnd;
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698