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 df935114b462563caaec2e0304e1baef383c096a..d781d9b65c69cbe72dd2eda2236e923d475f1e4c 100644 |
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
@@ -125,13 +125,12 @@ InputMethodController* InputMethodController::create(LocalFrame& frame) |
InputMethodController::InputMethodController(LocalFrame& frame) |
: m_frame(&frame) |
, m_isDirty(false) |
- , m_hasComposition(false) |
{ |
} |
bool InputMethodController::hasComposition() const |
{ |
- return m_hasComposition; |
+ return m_compositionRange && !m_compositionRange->collapsed(); |
} |
inline Editor& InputMethodController::editor() const |
@@ -141,7 +140,6 @@ inline Editor& InputMethodController::editor() const |
void InputMethodController::clear() |
{ |
- m_hasComposition = false; |
if (m_compositionRange) { |
m_compositionRange->setStart(frame().document(), 0); |
m_compositionRange->collapse(true); |
@@ -321,23 +319,6 @@ void InputMethodController::cancelComposition() |
dispatchCompositionEndEvent(frame(), emptyString()); |
} |
-void InputMethodController::cancelCompositionIfSelectionIsInvalid() |
-{ |
- if (!hasComposition() || editor().preventRevealSelection()) |
- return; |
- |
- // Check if selection start and selection end are valid. |
- FrameSelection& selection = frame().selection(); |
- if (!selection.isNone() && !m_compositionRange->collapsed()) { |
- if (selection.start().compareTo(m_compositionRange->startPosition()) >= 0 |
- && selection.end().compareTo(m_compositionRange->endPosition()) <= 0) |
- return; |
- } |
- |
- cancelComposition(); |
- frame().chromeClient().didCancelCompositionOnSelectionChange(); |
yosin_UTC9
2016/09/28 03:38:50
Could you add TODO comment in "ChromeClient.h" to
Changwan Ryu
2016/09/28 06:20:12
My bad, I just went ahead and removed it.
|
-} |
- |
void InputMethodController::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, int selectionStart, int selectionEnd) |
{ |
Editor::RevealSelectionScope revealSelectionScope(&editor()); |
@@ -436,7 +417,6 @@ void InputMethodController::setComposition(const String& text, const Vector<Comp |
return; |
m_isDirty = true; |
- m_hasComposition = true; |
if (!m_compositionRange) |
m_compositionRange = Range::create(baseNode->document()); |
m_compositionRange->setStart(baseNode, baseOffset); |
@@ -497,7 +477,6 @@ void InputMethodController::setCompositionFromExistingText(const Vector<Composit |
frame().document()->markers().addCompositionMarker(ephemeralLineRange.startPosition(), ephemeralLineRange.endPosition(), underline.color(), underline.thick(), underline.backgroundColor()); |
} |
- m_hasComposition = true; |
if (!m_compositionRange) |
m_compositionRange = Range::create(range.document()); |
m_compositionRange->setStart(range.startPosition()); |