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

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

Issue 1314433011: Introduce visiblePositionOf() for Position and PositionInComposedTree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-31T16:32:26 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/serializers/StyledMarkupSerializer.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 6b2c310fb7d6abacb7097721ac6af6d5907da133..a59fc86ebd5e4b34dd76b3edd5de7be8ecacb4ab 100644
--- a/Source/core/layout/PendingSelection.cpp
+++ b/Source/core/layout/PendingSelection.cpp
@@ -85,7 +85,7 @@ VisibleSelection PendingSelection::calcVisibleSelectionAlgorithm() const
SelectionType selectionType = VisibleSelection::selectionType(start, end);
TextAffinity affinity = m_selection.affinity();
- bool paintBlockCursor = m_shouldShowBlockCursor && selectionType == SelectionType::CaretSelection && !isLogicalEndOfLine(VisiblePosition(end, affinity));
+ bool paintBlockCursor = m_shouldShowBlockCursor && selectionType == SelectionType::CaretSelection && !isLogicalEndOfLine(visiblePositionOf(end, affinity));
VisibleSelection selection;
if (enclosingTextFormControl(start.computeContainerNode())) {
// TODO(yosin) We should use |PositionMoveType::Character| to avoid
@@ -95,13 +95,13 @@ VisibleSelection PendingSelection::calcVisibleSelectionAlgorithm() const
return selection;
}
- VisiblePosition visibleStart = VisiblePosition(start, selectionType == SelectionType::RangeSelection ? TextAffinity::Downstream : affinity);
+ VisiblePosition visibleStart = visiblePositionOf(start, selectionType == SelectionType::RangeSelection ? TextAffinity::Downstream : affinity);
if (paintBlockCursor) {
- VisiblePosition visibleExtent(end, affinity);
+ VisiblePosition visibleExtent = visiblePositionOf(end, affinity);
visibleExtent = nextPositionOf(visibleExtent, CanSkipOverEditingBoundary);
return VisibleSelection(visibleStart, visibleExtent);
}
- VisiblePosition visibleEnd(end, selectionType == SelectionType::RangeSelection ? TextAffinity::Upstream : affinity);
+ VisiblePosition visibleEnd = visiblePositionOf(end, selectionType == SelectionType::RangeSelection ? TextAffinity::Upstream : affinity);
return VisibleSelection(visibleStart, visibleEnd);
}
« no previous file with comments | « Source/core/editing/serializers/StyledMarkupSerializer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698