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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2732963002: Make SelectionController::setNonDirectionalSelectionIfNeeded() to take SelectionInFlatTree (Closed)
Patch Set: 2017-03-06T18:46:44 Created 3 years, 9 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: third_party/WebKit/Source/core/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index a84be9c1f3fa26aaa1e88944e4463dc0d47f98d8..8ce320eaa3a9ec47633fbaefef14d54b1c5af606 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -395,9 +395,9 @@ void SelectionController::updateSelectionForMouseDrag(
if (selection().granularity() != CharacterGranularity)
builder.setGranularity(selection().granularity());
- setNonDirectionalSelectionIfNeeded(
- createVisibleSelection(builder.build()), selection().granularity(),
Xiaocheng 2017/03/06 19:04:31 Guess this canonicalization is important and shoul
- AdjustEndpointsAtBidiBoundary, HandleVisibility::NotVisible);
+ setNonDirectionalSelectionIfNeeded(builder.build(), selection().granularity(),
+ AdjustEndpointsAtBidiBoundary,
+ HandleVisibility::NotVisible);
}
bool SelectionController::updateSelectionForMouseDownDispatchingSelectStart(
@@ -426,7 +426,7 @@ bool SelectionController::updateSelectionForMouseDownDispatchingSelectStart(
m_selectionState = SelectionState::PlacedCaret;
}
- setNonDirectionalSelectionIfNeeded(selection, granularity,
+ setNonDirectionalSelectionIfNeeded(selection.asSelection(), granularity,
DoNotAdjustEndpoints, handleVisibility);
return true;
@@ -635,10 +635,10 @@ static void adjustEndpointsAtBidiBoundary(
}
}
-// TODO(yosin): We should make |setNonDirectionalSelectionIfNeeded()| to take
-// |SelectionInFlatTree| instead of |VisibleSelectionInFlatTree|.
+// TODO(yosin): We should take |granularity| and |handleVisibility| from
+// |newSelection|.
void SelectionController::setNonDirectionalSelectionIfNeeded(
- const VisibleSelectionInFlatTree& newSelection,
+ const SelectionInFlatTree& newSelection,
TextGranularity granularity,
EndPointsAdjustmentMode endpointsAdjustmentMode,
HandleVisibility handleVisibility) {
@@ -661,7 +661,7 @@ void SelectionController::setNonDirectionalSelectionIfNeeded(
if (endpointsAdjustmentMode == AdjustEndpointsAtBidiBoundary)
adjustEndpointsAtBidiBoundary(newBase, newExtent);
- SelectionInFlatTree::Builder builder(newSelection.asSelection());
+ SelectionInFlatTree::Builder builder(newSelection);
if (newBase.deepEquivalent() != base.deepEquivalent() ||
newExtent.deepEquivalent() != extent.deepEquivalent()) {
m_originalBaseInFlatTree = base;

Powered by Google App Engine
This is Rietveld 408576698