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

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

Issue 2972753002: Make FrameSelection::MoveRangeSelection() not to set live granularity selection (Closed)
Patch Set: 2017-07-05T18:14:38 Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0c0c97180de781399fa076ce5f323a3945d93950..a47b5801221c528a6afd95a701e4feb883bdd8dc 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -1136,7 +1136,22 @@ void FrameSelection::MoveRangeSelection(const VisiblePosition& base_position,
if (new_selection.IsNone())
return;
- SetSelection(new_selection, kCloseTyping | kClearTypingStyle,
+ const VisibleSelection visible_selection =
+ CreateVisibleSelection(new_selection);
yoichio 2017/07/06 02:26:32 nlgtm Is this not VSinflattree?
yosin_UTC9 2017/07/06 03:24:21 Talked offline. We should use flat tree version of
+ if (visible_selection.IsNone())
+ return;
+
+ SelectionInDOMTree::Builder builder;
+ if (visible_selection.IsBaseFirst()) {
+ builder.SetBaseAndExtent(visible_selection.Start(),
+ visible_selection.End());
+ } else {
+ builder.SetBaseAndExtent(visible_selection.End(),
+ visible_selection.Start());
+ }
+ builder.SetAffinity(visible_selection.Affinity());
+ builder.SetIsHandleVisible(IsHandleVisible());
+ SetSelection(builder.Build(), kCloseTyping | kClearTypingStyle,
CursorAlignOnScroll::kIfNeeded, granularity);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698