| 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 640ef906d0bcba14e48e5c56267935d6899ce6ed..09fa2b222b7d4e2e3a48046b3730e87d0ffc6d81 100644
|
| --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
|
| @@ -99,7 +99,7 @@ FrameSelection::FrameSelection(LocalFrame* frame)
|
| , m_granularity(CharacterGranularity)
|
| , m_xPosForVerticalArrowNavigation(NoXPosForVerticalArrowNavigation())
|
| , m_focused(frame->page() && frame->page()->focusController().focusedFrame() == frame)
|
| - , m_frameCaret(new FrameCaret(frame))
|
| + , m_frameCaret(new FrameCaret(frame, *m_selectionEditor))
|
| {
|
| DCHECK(frame);
|
| }
|
| @@ -320,10 +320,7 @@ void FrameSelection::setSelectionAlgorithm(const VisibleSelectionTemplate<Strate
|
| const VisibleSelection oldSelectionInDOMTree = selection();
|
|
|
| m_selectionEditor->setVisibleSelection(s, options);
|
| - if (s.isCaret())
|
| - m_frameCaret->setCaretPosition(PositionWithAffinity(toPositionInDOMTree(s.start()), s.affinity()));
|
| - else
|
| - m_frameCaret->clear();
|
| + m_frameCaret->setCaretRectNeedsUpdate();
|
|
|
| if (!s.isNone() && !(options & DoNotSetFocus)) {
|
| setFocusedNodeIfNeeded();
|
| @@ -477,15 +474,9 @@ void FrameSelection::respondToNodeModification(Node& node, bool baseRemoved, boo
|
| if (clearLayoutTreeSelection)
|
| selection().start().document()->layoutViewItem().clearSelection();
|
|
|
| - if (clearDOMTreeSelection) {
|
| + if (clearDOMTreeSelection)
|
| setSelection(VisibleSelection(), DoNotSetFocus);
|
| - } else {
|
| - const VisibleSelection& selection = m_selectionEditor->visibleSelection<EditingStrategy>();
|
| - if (selection.isCaret())
|
| - m_frameCaret->setCaretPosition(PositionWithAffinity(selection.start(), selection.affinity()));
|
| - else
|
| - m_frameCaret->clear();
|
| - }
|
| + m_frameCaret->setCaretRectNeedsUpdate();
|
|
|
| // TODO(yosin): We should move to call |TypingCommand::closeTyping()| to
|
| // |Editor| class.
|
|
|