Chromium Code Reviews| 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 695b8c39c3ccded865a45f80ca40583871c2c870..71f7c8c2d0281b24386970ea98c55c9554948161 100644 |
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| @@ -74,8 +74,8 @@ void dispatchCompositionEndEvent(LocalFrame& frame, const String& text) |
| // TODO(chongz): 4. Fire 'input' event |
| void insertTextDuringCompositionWithEvents(LocalFrame& frame, const String& text, TypingCommand::Options options, TypingCommand::TextCompositionType compositionType) |
| { |
| - DCHECK(compositionType == TypingCommand::TextCompositionType::TextCompositionUpdate || compositionType == TypingCommand::TextCompositionType::TextCompositionConfirm) |
| - << "compositionType should be TextCompositionUpdate or TextCompositionConfirm, but got " << static_cast<int>(compositionType); |
| + DCHECK(compositionType == TypingCommand::TextCompositionType::TextCompositionUpdate || compositionType == TypingCommand::TextCompositionType::TextCompositionConfirm || compositionType == TypingCommand::TextCompositionType::TextCompositionCancel) |
| + << "compositionType should be TextCompositionUpdate or TextCompositionConfirm or TextCompositionCancel, but got " << static_cast<int>(compositionType); |
| if (!frame.document()) |
| return; |
| @@ -103,9 +103,10 @@ void insertTextDuringCompositionWithEvents(LocalFrame& frame, const String& text |
| switch (compositionType) { |
| case TypingCommand::TextCompositionType::TextCompositionUpdate: |
| + case TypingCommand::TextCompositionType::TextCompositionConfirm: |
| TypingCommand::insertText(*frame.document(), text, options, compositionType); |
| break; |
| - case TypingCommand::TextCompositionType::TextCompositionConfirm: |
| + case TypingCommand::TextCompositionType::TextCompositionCancel: |
| // TODO(chongz): Use TypingCommand::insertText after TextEvent was removed. (Removed from spec since 2012) |
| // See TextEvent.idl. |
| frame.eventHandler().handleTextInputEvent(text, 0, TextEventInputComposition); |
| @@ -273,7 +274,7 @@ void InputMethodController::cancelComposition() |
| // TODO(chongz): Update InputType::DeleteComposedCharacter with latest discussion. |
| dispatchBeforeInputFromComposition(frame().document()->focusedElement(), InputEvent::InputType::DeleteComposedCharacter, emptyString(), InputEvent::EventCancelable::NotCancelable); |
| dispatchCompositionUpdateEvent(frame(), emptyString()); |
| - insertTextDuringCompositionWithEvents(frame(), emptyString(), 0, TypingCommand::TextCompositionType::TextCompositionConfirm); |
| + insertTextDuringCompositionWithEvents(frame(), emptyString(), 0, TypingCommand::TextCompositionType::TextCompositionCancel); |
|
Changwan Ryu
2016/07/14 02:11:08
any chance that we incorrectly adjust selection fo
|
| // Event handler might destroy document. |
| if (!frame().document()) |
| return; |