diff options
Diffstat (limited to 'WebCore/page/FocusController.cpp')
-rw-r--r-- | WebCore/page/FocusController.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp index 6ecdffd..53a4fa8 100644 --- a/WebCore/page/FocusController.cpp +++ b/WebCore/page/FocusController.cpp @@ -595,22 +595,21 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra if (oldFocusedNode && oldFocusedNode->rootEditableElement() == oldFocusedNode && !relinquishesEditingFocus(oldFocusedNode)) return false; - // Set input method state before changing the focused node, so that the - // input method can still have a chance to finish the ongoing composition - // session. - m_page->editorClient()->setInputMethodState(node ? node->shouldUseInputMethod() : false); + m_page->editorClient()->willSetInputMethodState(); clearSelectionIfNeeded(oldFocusedFrame.get(), newFocusedFrame.get(), node); if (!node) { if (oldDocument) oldDocument->setFocusedNode(0); + m_page->editorClient()->setInputMethodState(false); return true; } RefPtr<Document> newDocument = node->document(); if (newDocument && newDocument->focusedNode() == node) { + m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod()); return true; } @@ -622,6 +621,8 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra if (newDocument) newDocument->setFocusedNode(node); + m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod()); + return true; } |