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 47f5c0d3e4a2bcd47a4874c779b4371943aee441..d1fc6e16bc899012ce23a74eb68e3668b3d3b6e9 100644 |
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
@@ -183,19 +183,20 @@ void FrameSelection::setSelectionAlgorithm( |
DCHECK(isAvailable()); |
DCHECK(newSelection.isValidFor(document())); |
const Document& currentDocument = document(); |
+ // TODO(editing-dev): We should rename variable |s| to another name to avoid |
+ // using one letter variable name. |
+ VisibleSelectionTemplate<Strategy> s = newSelection; |
+ |
if (m_granularityStrategy && |
(options & FrameSelection::DoNotClearStrategy) == 0) |
m_granularityStrategy->Clear(); |
bool closeTyping = options & CloseTyping; |
bool shouldClearTypingStyle = options & ClearTypingStyle; |
- const HandleVisibility handleVisibility = options & HandleVisible |
- ? HandleVisibility::Visible |
- : HandleVisibility::NotVisible; |
+ const HandleVisibility handleVisibility = |
+ (options & HandleVisible || s.isHandleVisible()) |
+ ? HandleVisibility::Visible |
+ : HandleVisibility::NotVisible; |
EUserTriggered userTriggered = selectionOptionsToUserTriggered(options); |
- |
- // TODO(editing-dev): We should rename variable |s| to another name to avoid |
- // using one letter variable name. |
- VisibleSelectionTemplate<Strategy> s = newSelection; |
if (shouldAlwaysUseDirectionalSelection(m_frame)) |
s.setIsDirectional(true); |