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

Unified Diff: Source/core/editing/EditingUtilities.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 | « no previous file | Source/core/editing/Editor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingUtilities.cpp
diff --git a/Source/core/editing/EditingUtilities.cpp b/Source/core/editing/EditingUtilities.cpp
index f9f43ba9a937a160d513d274bd69ddf269d15c52..d15520ded9c27affd758be35b8b03b5ded9dfbcf 100644
--- a/Source/core/editing/EditingUtilities.cpp
+++ b/Source/core/editing/EditingUtilities.cpp
@@ -798,7 +798,7 @@ static HTMLElement* firstInSpecialElement(const Position& pos)
HTMLElement* specialElement = toHTMLElement(n);
VisiblePosition vPos = VisiblePosition(pos);
VisiblePosition firstInElement = VisiblePosition(firstPositionInOrBeforeNode(specialElement));
- if (isRenderedTableElement(specialElement) && vPos.deepEquivalent() == firstInElement.next().deepEquivalent())
+ if (isRenderedTableElement(specialElement) && vPos.deepEquivalent() == nextPositionOf(firstInElement).deepEquivalent())
return specialElement;
if (vPos.deepEquivalent() == firstInElement.deepEquivalent())
return specialElement;
@@ -1366,7 +1366,7 @@ Position trailingWhitespacePosition(const Position& position, TextAffinity, Whit
UChar characterAfterVisiblePosition = visiblePosition.characterAfter();
bool isSpace = option == ConsiderNonCollapsibleWhitespace ? (isSpaceOrNewline(characterAfterVisiblePosition) || characterAfterVisiblePosition == noBreakSpaceCharacter) : isCollapsibleWhitespace(characterAfterVisiblePosition);
// The space must not be in another paragraph and it must be editable.
- if (isSpace && !isEndOfParagraph(visiblePosition) && visiblePosition.next(CannotCrossEditingBoundary).isNotNull())
+ if (isSpace && !isEndOfParagraph(visiblePosition) && nextPositionOf(visiblePosition, CannotCrossEditingBoundary).isNotNull())
return position;
return Position();
}
@@ -1480,7 +1480,7 @@ VisibleSelection selectionForParagraphIteration(const VisibleSelection& original
// containing the table itself.
if (Element* table = isLastPositionBeforeTable(startOfSelection)) {
if (endOfSelection.deepEquivalent().anchorNode()->isDescendantOf(table))
- newSelection = VisibleSelection(startOfSelection.next(CannotCrossEditingBoundary), endOfSelection);
+ newSelection = VisibleSelection(nextPositionOf(startOfSelection, CannotCrossEditingBoundary), endOfSelection);
}
return newSelection;
@@ -1606,7 +1606,7 @@ Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selec
// if the selection starts just before a paragraph break, skip over it
if (isEndOfParagraph(visiblePosition))
- return mostForwardCaretPosition(visiblePosition.next().deepEquivalent());
+ return mostForwardCaretPosition(nextPositionOf(visiblePosition).deepEquivalent());
// otherwise, make sure to be at the start of the first selected node,
// instead of possibly at the end of the last node before the selection
« no previous file with comments | « no previous file | Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698