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

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

Issue 2646963002: Stop dismissing selection handles when selection is kept (Closed)
Patch Set: avoid control flow in IMC and rebase Created 3 years, 11 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/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);

Powered by Google App Engine
This is Rietveld 408576698