| 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 7e84c28e961275ba27bf179d8acb45b8db3fe55b..a43eda8972ff6b35437e773ab8566842cb5c3909 100644
|
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
| @@ -214,13 +214,18 @@ bool InputMethodController::finishComposingText(
|
| PlainTextRange oldOffsets = getSelectionOffsets();
|
| Editor::RevealSelectionScope revealSelectionScope(&editor());
|
|
|
| - bool result = replaceComposition(composingText());
|
| + const String& composing = composingText();
|
| + const bool result = replaceComposition(composing);
|
|
|
| // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| // needs to be audited. see http://crbug.com/590369 for more details.
|
| frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
|
|
| setSelectionOffsets(oldOffsets);
|
| +
|
| + // No DOM update after 'compositionend'.
|
| + dispatchCompositionEndEvent(frame(), composing);
|
| +
|
| return result;
|
| }
|
|
|
| @@ -277,9 +282,6 @@ bool InputMethodController::replaceComposition(const String& text) {
|
| if (!frame().document())
|
| return false;
|
|
|
| - // No DOM update after 'compositionend'.
|
| - dispatchCompositionEndEvent(frame(), text);
|
| -
|
| return true;
|
| }
|
|
|
| @@ -307,7 +309,13 @@ bool InputMethodController::replaceCompositionAndMoveCaret(
|
|
|
| int absoluteCaretPosition = computeAbsoluteCaretPosition(
|
| textStart, text.length(), relativeCaretPosition);
|
| - return moveCaret(absoluteCaretPosition);
|
| + if (!moveCaret(absoluteCaretPosition))
|
| + return false;
|
| +
|
| + // No DOM update after 'compositionend'.
|
| + dispatchCompositionEndEvent(frame(), text);
|
| +
|
| + return true;
|
| }
|
|
|
| bool InputMethodController::insertText(const String& text) {
|
| @@ -618,7 +626,9 @@ void InputMethodController::setComposition(
|
| frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
|
|
| setEditableSelectionOffsets(selectedRange);
|
| - return;
|
| +
|
| + // No DOM update after 'compositionend'.
|
| + return dispatchCompositionEndEvent(frame(), text);
|
| }
|
|
|
| // We should send a 'compositionstart' event only when the given text is not
|
|
|