Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(884)

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2529803002: [Editing] Let InputMethodController::hasComposition check Range::isConnected(). (Closed)
Patch Set: update Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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())

Powered by Google App Engine
This is Rietveld 408576698