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 fa406b5295850c63a436280e4e7d1fe9ee70786c..449c644a6dedce02f41b71e0dcb7cc15a8d18d00 100644 |
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| @@ -182,7 +182,8 @@ Document& InputMethodController::document() const { |
| } |
| bool InputMethodController::hasComposition() const { |
| - return m_hasComposition; |
| + return m_hasComposition && !m_compositionRange->collapsed() && |
| + m_compositionRange->isConnected(); |
| } |
| inline Editor& InputMethodController::editor() const { |
| @@ -314,6 +315,8 @@ bool InputMethodController::replaceCompositionAndMoveCaret( |
| Element* rootEditableElement = frame().selection().rootEditableElement(); |
| if (!rootEditableElement) |
| return false; |
| + if (!hasComposition()) |
| + return false; |
|
Changwan Ryu
2016/11/24 09:15:00
This is probably not needed.
yosin_UTC9
2016/11/25 01:28:22
Let's use |DCHECK(hasComposition()|
yoichio
2016/11/25 09:19:41
Done.
|
| PlainTextRange compositionRange = |
| PlainTextRange::create(*rootEditableElement, *m_compositionRange); |
| if (compositionRange.isNull()) |