| Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| index 0238e0b185480ab4010b2ce338dc56d0336b45ea..d34e44394e65f0dff87a43f28f6769db8438935f 100644
|
| --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| @@ -170,7 +170,7 @@ void FrameSelection::moveCaretSelection(const IntPoint& point) {
|
| if (position.isNotNull())
|
| builder.collapse(position.toPositionWithAffinity());
|
| setSelection(builder.build(),
|
| - CloseTyping | ClearTypingStyle | UserTriggered | HandleVisible);
|
| + CloseTyping | ClearTypingStyle | UserTriggered | ShowHandle);
|
| }
|
|
|
| template <typename Strategy>
|
| @@ -187,9 +187,13 @@ void FrameSelection::setSelectionAlgorithm(
|
| m_granularityStrategy->Clear();
|
| bool closeTyping = options & CloseTyping;
|
| bool shouldClearTypingStyle = options & ClearTypingStyle;
|
| - const HandleVisibility handleVisibility = options & HandleVisible
|
| - ? HandleVisibility::Visible
|
| - : HandleVisibility::NotVisible;
|
| + bool showHandle = options & ShowHandle;
|
| + bool preserveHandle = options & PreserveHandle;
|
| + DCHECK(!(showHandle && preserveHandle));
|
| + const HandleVisibility handleVisibility =
|
| + showHandle || (preserveHandle && isHandleVisible())
|
| + ? HandleVisibility::Visible
|
| + : HandleVisibility::NotVisible;
|
| EUserTriggered userTriggered = selectionOptionsToUserTriggered(options);
|
|
|
| // TODO(editing-dev): We should rename variable |s| to another name to avoid
|
| @@ -913,7 +917,8 @@ void FrameSelection::selectAll() {
|
| return;
|
| }
|
|
|
| - setSelection(SelectionInDOMTree::Builder().selectAllChildren(*root).build());
|
| + setSelection(SelectionInDOMTree::Builder().selectAllChildren(*root).build(),
|
| + CloseTyping | ClearTypingStyle | PreserveHandle);
|
| selectFrameElementInParentIfFullySelected();
|
| notifyLayoutObjectOfSelectionChange(UserTriggered);
|
| }
|
| @@ -1354,7 +1359,7 @@ void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) {
|
| setSelection(newSelection,
|
| FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle |
|
| FrameSelection::DoNotClearStrategy | UserTriggered |
|
| - FrameSelection::HandleVisible,
|
| + FrameSelection::ShowHandle,
|
| CursorAlignOnScroll::IfNeeded, CharacterGranularity);
|
| }
|
|
|
| @@ -1375,9 +1380,7 @@ void FrameSelection::moveRangeSelection(const VisiblePosition& basePosition,
|
| if (newSelection.isNone())
|
| return;
|
|
|
| - SetSelectionOptions options = CloseTyping | ClearTypingStyle;
|
| - if (isHandleVisible())
|
| - options |= HandleVisible;
|
| + SetSelectionOptions options = CloseTyping | ClearTypingStyle | PreserveHandle;
|
| setSelection(newSelection, options, CursorAlignOnScroll::IfNeeded,
|
| granularity);
|
| }
|
|
|