Cancel composition when focused node was changed
[framework/web/webkit-efl.git] / Source / WebKit2 / WebProcess / WebCoreSupport / WebEditorClient.cpp
index 3c1d933..b191233 100755 (executable)
@@ -191,7 +191,12 @@ void WebEditorClient::respondToChangedSelection(Frame* frame)
         return;
 
     EditorState state = m_page->editorState();
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+
+#if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+    const EditorState& currentState = m_page->currentEditorState();
+    if (currentState.hasComposition && currentState.inputMethodContextID != state.inputMethodContextID)
+        didCancelComposition(reinterpret_cast<Node*>(currentState.inputMethodContextID));
+
     m_page->setEditorState(state);
 #endif
 
@@ -470,10 +475,6 @@ void WebEditorClient::willSetInputMethodState()
 
 void WebEditorClient::setInputMethodState(bool active)
 {
-#if ENABLE(TIZEN_ISF_PORT)
-    m_page->send(Messages::WebPageProxy::SetInputMethodState(active));
-    return;
-#endif
     notImplemented();
 }