Chromium Code Reviews| 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; |