| Index: third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| index 50c4d95d121410f20ccfe36e4d0942ff890e6f28..9d5d85472d7efb2c362b4874ab4769c491192e5b 100644
|
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| @@ -247,22 +247,34 @@ bool InputMethodController::finishComposingText(
|
| if (!hasComposition())
|
| return false;
|
|
|
| + const String& composing = composingText();
|
| +
|
| if (confirmBehavior == KeepSelection) {
|
| PlainTextRange oldOffsets = getSelectionOffsets();
|
| Editor::RevealSelectionScope revealSelectionScope(&editor());
|
|
|
| - bool result = replaceComposition(composingText());
|
| -
|
| - // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| - // needs to be audited. see http://crbug.com/590369 for more details.
|
| - document().updateStyleAndLayoutIgnorePendingStylesheets();
|
| + clear();
|
|
|
| + dispatchCompositionEndEvent(frame(), composing);
|
| setSelectionOffsets(oldOffsets);
|
| - return result;
|
| + return true;
|
| }
|
|
|
| - return replaceCompositionAndMoveCaret(composingText(), 0,
|
| - Vector<CompositionUnderline>());
|
| + Element* rootEditableElement = frame().selection().rootEditableElement();
|
| + if (!rootEditableElement)
|
| + return false;
|
| + PlainTextRange compositionRange =
|
| + PlainTextRange::create(*rootEditableElement, *m_compositionRange);
|
| + if (compositionRange.isNull())
|
| + return false;
|
| +
|
| + clear();
|
| +
|
| + if (!moveCaret(compositionRange.end()))
|
| + return false;
|
| +
|
| + dispatchCompositionEndEvent(frame(), composing);
|
| + return true;
|
| }
|
|
|
| bool InputMethodController::commitText(
|
|
|