| 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 6678945ae9d9f44b016017d717c74d0514d95c4c..e144382666975d00c41e0f84d873f985e27f75c0 100644
|
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| @@ -264,22 +264,37 @@ 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());
|
| + clear();
|
| + dispatchCompositionEndEvent(frame(), composing);
|
|
|
| // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| // needs to be audited. see http://crbug.com/590369 for more details.
|
| document().updateStyleAndLayoutIgnorePendingStylesheets();
|
| -
|
| 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(
|
|
|