| 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 00a2520dc2c8994200524371b14abf1677c16311..5d5d0f8854b232ae5e5d8ff88be24c42b2621ceb 100644
|
| --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| @@ -457,7 +457,7 @@
|
| selection().start().document()->layoutViewItem().clearSelection();
|
|
|
| if (clearDOMTreeSelection)
|
| - setSelection(SelectionInDOMTree(), DoNotSetFocus);
|
| + setSelection(VisibleSelection(), DoNotSetFocus);
|
| m_frameCaret->setCaretRectNeedsUpdate();
|
|
|
| // TODO(yosin): We should move to call |TypingCommand::closeTyping()| to
|
| @@ -697,7 +697,7 @@
|
| m_granularity = CharacterGranularity;
|
| if (m_granularityStrategy)
|
| m_granularityStrategy->Clear();
|
| - setSelection(SelectionInDOMTree());
|
| + setSelection(VisibleSelection());
|
| }
|
|
|
| void FrameSelection::documentAttached(Document* document) {
|
| @@ -851,8 +851,6 @@
|
| // Focus on the parent frame, and then select from before this element to
|
| // after.
|
| VisibleSelection newSelection = createVisibleSelection(builder.build());
|
| - // TODO(yosin): We should call |FocusController::setFocusedFrame()| before
|
| - // |createVisibleSelection()|.
|
| page->focusController().setFocusedFrame(parent);
|
| // setFocusedFrame can dispatch synchronous focus/blur events. The document
|
| // tree might be modified.
|
| @@ -1294,12 +1292,13 @@
|
| String text =
|
| plainText(EphemeralRange(start.deepEquivalent(), end.deepEquivalent()));
|
| if (!text.isEmpty() && !isSeparator(text.characterStartingAt(0))) {
|
| - setSelection(SelectionInDOMTree::Builder()
|
| - .collapse(start.toPositionWithAffinity())
|
| - .extend(end.deepEquivalent())
|
| - .build(),
|
| - CloseTyping | ClearTypingStyle,
|
| - CursorAlignOnScroll::IfNeeded, WordGranularity);
|
| + setSelection(
|
| + createVisibleSelection(SelectionInDOMTree::Builder()
|
| + .collapse(start.toPositionWithAffinity())
|
| + .extend(end.deepEquivalent())
|
| + .build()),
|
| + CloseTyping | ClearTypingStyle, CursorAlignOnScroll::IfNeeded,
|
| + WordGranularity);
|
| return true;
|
| }
|
| }
|
|
|