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

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

Issue 2201853002: Blink handle selection handle visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing aura problems Created 4 years, 5 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 b179f6169ea68ec30846fb7b92807c9e86bea756..8656d369acd6e81c4b7fe4eed2c21ebf93ddaf02 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -176,7 +176,8 @@ const VisibleSelectionInFlatTree& FrameSelection::selectionInFlatTree() const
void FrameSelection::moveTo(const VisiblePosition &pos, EUserTriggered userTriggered, CursorAlignOnScroll align)
{
SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered;
- setSelection(VisibleSelection(pos, pos, selection().isDirectional()), options, align);
+ bool isHandleVisible = userTriggered == UserTriggered;
+ setSelection(VisibleSelection(pos, pos, selection().isDirectional(), isHandleVisible), options, align);
}
void FrameSelection::moveTo(const VisiblePosition &base, const VisiblePosition &extent, EUserTriggered userTriggered)
@@ -1269,7 +1270,9 @@ bool FrameSelection::selectWordAroundPosition(const VisiblePosition& position)
VisiblePosition end = endOfWord(position, wordSide);
String text = plainText(EphemeralRange(start.deepEquivalent(), end.deepEquivalent()));
if (!text.isEmpty() && !isSeparator(text.characterStartingAt(0))) {
- setSelection(VisibleSelection(start, end), WordGranularity);
+ VisibleSelection newSelection(start, end);
+ newSelection.setIsHandleVisible(selection().isHandleVisible());
+ setSelection(newSelection, WordGranularity);
return true;
}
}
@@ -1303,6 +1306,7 @@ void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint)
return;
VisibleSelection newSelection = granularityStrategy()->updateExtent(contentsPoint, m_frame);
+ newSelection.setIsHandleVisible(true);
setSelection(
newSelection,
FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | FrameSelection::DoNotClearStrategy | UserTriggered,

Powered by Google App Engine
This is Rietveld 408576698