Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/Editor.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp |
| index 2fc9b42fc338aee591b90e97681a6c6115edeaa3..dd10b500ad4607284c8877dc5e79bbda21e7477d 100644 |
| --- a/third_party/WebKit/Source/core/editing/Editor.cpp |
| +++ b/third_party/WebKit/Source/core/editing/Editor.cpp |
| @@ -919,14 +919,15 @@ static void DispatchEditableContentChangedEvents(Element* start_root, |
| static SelectionInDOMTree CorrectedSelectionAfterCommand( |
|
yosin_UTC9
2017/05/23 01:46:36
Is it better to pass FrameSelection instead of Doc
|
| const VisibleSelection& passed_selection, |
| - Document* document) { |
| + Document* document, |
| + bool is_handle_visible) { |
|
yosin_UTC9
2017/05/23 01:46:36
We should use |HandleVisibility|.
|
| if (!passed_selection.Base().IsConnected() || |
| !passed_selection.Extent().IsConnected() || |
| passed_selection.Base().GetDocument() != document || |
| passed_selection.Base().GetDocument() != |
| passed_selection.Extent().GetDocument()) |
| return SelectionInDOMTree(); |
| - return passed_selection.AsSelection(); |
| + return passed_selection.AsSelection(is_handle_visible); |
|
yosin_UTC9
2017/05/23 01:46:36
Please use SelectionInDOMTree::Builder as
return
|
| } |
| void Editor::AppliedEditing(CompositeEditCommand* cmd) { |
| @@ -947,7 +948,8 @@ void Editor::AppliedEditing(CompositeEditCommand* cmd) { |
| cmd->TextDataForInputEvent(), IsComposingFromCommand(cmd)); |
| const SelectionInDOMTree& new_selection = CorrectedSelectionAfterCommand( |
| - cmd->EndingSelection(), GetFrame().GetDocument()); |
| + cmd->EndingSelection(), GetFrame().GetDocument(), |
| + GetFrame().Selection().IsHandleVisible()); |
| // Don't clear the typing style with this selection change. We do those things |
| // elsewhere if necessary. |
| @@ -989,7 +991,8 @@ void Editor::UnappliedEditing(UndoStep* cmd) { |
| InputEvent::EventIsComposing::kNotComposing); |
| const SelectionInDOMTree& new_selection = CorrectedSelectionAfterCommand( |
| - cmd->StartingSelection(), GetFrame().GetDocument()); |
| + cmd->StartingSelection(), GetFrame().GetDocument(), |
| + GetFrame().Selection().IsHandleVisible()); |
| ChangeSelectionAfterCommand( |
| new_selection, |
| FrameSelection::kCloseTyping | FrameSelection::kClearTypingStyle); |
| @@ -1010,7 +1013,8 @@ void Editor::ReappliedEditing(UndoStep* cmd) { |
| InputEvent::EventIsComposing::kNotComposing); |
| const SelectionInDOMTree& new_selection = CorrectedSelectionAfterCommand( |
| - cmd->EndingSelection(), GetFrame().GetDocument()); |
| + cmd->EndingSelection(), GetFrame().GetDocument(), |
| + GetFrame().Selection().IsHandleVisible()); |
| ChangeSelectionAfterCommand( |
| new_selection, |
| FrameSelection::kCloseTyping | FrameSelection::kClearTypingStyle); |