| 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 df3a10d601da448046f48b3ae3b1b655a928d5b2..d300915e5f6cd1b7ab257ea71f236d71d8a6a250 100644
|
| --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| @@ -154,12 +154,20 @@ const VisibleSelectionInFlatTree& FrameSelection::selectionInFlatTree() const {
|
| return visibleSelection<EditingInFlatTreeStrategy>();
|
| }
|
|
|
| -void FrameSelection::moveTo(const VisiblePosition& pos,
|
| - EUserTriggered userTriggered,
|
| - CursorAlignOnScroll align) {
|
| - SetSelectionOptions options = CloseTyping | ClearTypingStyle | userTriggered;
|
| - setSelection(createVisibleSelection(pos, pos, selection().isDirectional()),
|
| - options, align);
|
| +void FrameSelection::moveCaretSelection(const IntPoint& point) {
|
| + DCHECK(!document().needsLayoutTreeUpdate());
|
| +
|
| + Element* const editable = rootEditableElement();
|
| + if (!editable)
|
| + return;
|
| +
|
| + const VisiblePosition position =
|
| + visiblePositionForContentsPoint(point, frame());
|
| + SelectionInDOMTree::Builder builder;
|
| + builder.setIsDirectional(selection().isDirectional());
|
| + if (position.isNotNull())
|
| + builder.collapse(position.toPositionWithAffinity());
|
| + setSelection(builder.build(), CloseTyping | ClearTypingStyle | UserTriggered);
|
| }
|
|
|
| // TODO(xiaochengh): We should not use reference to return value.
|
|
|