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

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

Issue 2732963002: Make SelectionController::setNonDirectionalSelectionIfNeeded() to take SelectionInFlatTree (Closed)
Patch Set: 2017-03-07T13:12:10 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..47f38d3768d88e7fae781670a60130f382942056 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(),
- 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& passedSelection,
TextGranularity granularity,
EndPointsAdjustmentMode endpointsAdjustmentMode,
HandleVisibility handleVisibility) {
@@ -646,6 +646,8 @@ void SelectionController::setNonDirectionalSelectionIfNeeded(
// needs to be audited. See http://crbug.com/590369 for more details.
document().updateStyleAndLayoutIgnorePendingStylesheets();
+ const VisibleSelectionInFlatTree& newSelection =
+ createVisibleSelection(passedSelection);
const PositionInFlatTree& basePosition =
m_originalBaseInFlatTree.deepEquivalent();
const VisiblePositionInFlatTree& originalBase =

Powered by Google App Engine
This is Rietveld 408576698