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 5d0c85686a345b6edbb41d7c3b46bb40eaa3ee0f..91de813592fa2e34996ae4f5af0ec5dbb9b201a9 100644 |
| --- a/third_party/WebKit/Source/core/editing/Editor.cpp |
| +++ b/third_party/WebKit/Source/core/editing/Editor.cpp |
| @@ -1407,14 +1407,10 @@ void Editor::transpose() { |
| return; |
| String transposed = text.right(1) + text.left(1); |
| - // Select the two characters. |
| - if (createVisibleSelection(newSelection) != |
| - frame().selection().computeVisibleSelectionInDOMTreeDeprecated()) |
| - frame().selection().setSelection(newSelection); |
| - |
| if (dispatchBeforeInputInsertText( |
| eventTargetNodeForDocument(frame().document()), transposed, |
| - InputEvent::InputType::InsertTranspose) != |
| + InputEvent::InputType::InsertTranspose, |
| + new StaticRangeVector(1, StaticRange::create(range))) != |
| DispatchEventResult::NotCanceled) |
| return; |
| @@ -1426,6 +1422,11 @@ void Editor::transpose() { |
| // needs to be audited. see http://crbug.com/590369 for more details. |
| frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| + // Select the two characters. |
| + if (createVisibleSelection(newSelection) != |
| + frame().selection().computeVisibleSelectionInDOMTreeDeprecated()) |
|
yosin_UTC9
2017/03/28 07:08:35
nit: Since L1423 update layout, we don't need to u
chongz
2017/03/28 20:46:47
Done.
|
| + frame().selection().setSelection(newSelection); |
| + |
| // Insert the transposed characters. |
| replaceSelectionWithText(transposed, false, false, |
| InputEvent::InputType::InsertTranspose); |