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

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

Issue 2529803002: [Editing] Let InputMethodController::hasComposition check Range::isConnected(). (Closed)
Patch Set: Move to InputMethodConrollerTest 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..465fc735662f7250e044354ec2211c1af5cf49e4 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,7 @@ bool InputMethodController::replaceCompositionAndMoveCaret(
Element* rootEditableElement = frame().selection().rootEditableElement();
if (!rootEditableElement)
return false;
+ DCHECK(hasComposition());
PlainTextRange compositionRange =
PlainTextRange::create(*rootEditableElement, *m_compositionRange);
if (compositionRange.isNull())
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698