Chromium Code Reviews| 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); |
| } |