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

Unified Diff: Source/core/layout/PendingSelection.cpp

Issue 1305963003: Introduce {next,previous}PositionOf() as replacement of {next,previous}() member functions in Positi (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-22T00:12:04 Rebase 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/commands/TypingCommand.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/PendingSelection.cpp
diff --git a/Source/core/layout/PendingSelection.cpp b/Source/core/layout/PendingSelection.cpp
index 7faf797afed4c752feb187ac758cc39fc503a129..49fc55bbf5b66d64624a0c98e2413d1e5673bbbb 100644
--- a/Source/core/layout/PendingSelection.cpp
+++ b/Source/core/layout/PendingSelection.cpp
@@ -87,7 +87,9 @@ VisibleSelection PendingSelection::calcVisibleSelectionAlgorithm() const
bool paintBlockCursor = m_shouldShowBlockCursor && selectionType == SelectionType::CaretSelection && !isLogicalEndOfLine(VisiblePosition(end, affinity));
VisibleSelection selection;
if (enclosingTextFormControl(start.computeContainerNode())) {
- PositionType endPosition = paintBlockCursor ? Strategy::selectionExtent(m_selection).next() : end;
+ // TODO(yosin) We should use |PositionMoveType::Character| to avoid
+ // ending paint at middle of character.
+ PositionType endPosition = paintBlockCursor ? nextPositionOf(Strategy::selectionExtent(m_selection), PositionMoveType::CodePoint) : end;
selection.setWithoutValidation(start, endPosition);
return selection;
}
« no previous file with comments | « Source/core/editing/commands/TypingCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698