[WK2] Change how to handle keypad
authorSeokju Kwon <seokju.kwon@samsung.com>
Wed, 22 Aug 2012 10:42:12 +0000 (19:42 +0900)
committerSeokju Kwon <seokju.kwon@samsung.com>
Mon, 27 Aug 2012 23:21:54 +0000 (08:21 +0900)
[Title] Change how to handle keypad
[Issue#] N/A
[Problem] It isn't working to hide/show keypad properly
[Cause] Dismatch between ui and web process
[Solution] Change a sequence of condition check for keypad
           And Remove unnecessary code

Change-Id: Id7309b4f1578ef6f0f461caab26942b74d6adf7a

15 files changed:
Source/WebCore/dom/Node.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebKit2/Shared/EditorState.h
Source/WebKit2/UIProcess/API/efl/GestureClient.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index c78338d..f1768bf 100644 (file)
 #include "HTMLPropertiesCollection.h"
 #endif
 
+#if ENABLE(TIZEN_ISF_PORT)
+#include "EditorClient.h"
+#endif
+
 using namespace std;
 
 namespace WebCore {
@@ -2801,7 +2805,14 @@ void Node::dispatchFocusEvent(PassRefPtr<Node> oldFocusedNode)
 {
     if (document()->page())
         document()->page()->chrome()->client()->elementDidFocus(this);
-    
+
+#if ENABLE(TIZEN_ISF_PORT)
+    if (!oldFocusedNode && this->shouldUseInputMethod() && document()->frame()) {
+        LOG(ISF, "%s oldFocusedNode(%s) node(%s)\n", __func__, oldFocusedNode ? oldFocusedNode->nodeName().utf8().data() : "0", this->nodeName().utf8().data());
+        document()->frame()->editor()->client()->setInputMethodState(true);
+    }
+#endif
+
     EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(oldFocusedNode));
 }
 
@@ -2810,6 +2821,13 @@ void Node::dispatchBlurEvent(PassRefPtr<Node> newFocusedNode)
     if (document()->page())
         document()->page()->chrome()->client()->elementDidBlur(this);
 
+#if ENABLE(TIZEN_ISF_PORT)
+    if (!newFocusedNode && this->shouldUseInputMethod() && document()->frame()) {
+        LOG(ISF, "%s newFocusedNode(%s) node(%s)\n", __func__, newFocusedNode ? newFocusedNode->nodeName().utf8().data() : "0", this->nodeName().utf8().data());
+        document()->frame()->editor()->client()->setInputMethodState(false);
+    }
+#endif
+
     EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(newFocusedNode));
 }
 
index 7b3194f..d1c6709 100644 (file)
@@ -52,9 +52,6 @@
 #include "DeviceOrientationController.h"
 #include "Document.h"
 #include "DocumentLoader.h"
-#if ENABLE(TIZEN_ISF_PORT)
-#include "EditorClient.h"
-#endif
 #include "Element.h"
 #include "EventException.h"
 #include "EventListener.h"
@@ -72,9 +69,6 @@
 #include "InspectorInstrumentation.h"
 #include "KURL.h"
 #include "Location.h"
-#if ENABLE(TIZEN_ISF_PORT)
-#include "Logging.h"
-#endif
 #include "MediaQueryList.h"
 #include "MediaQueryMatcher.h"
 #include "MessageEvent.h"
@@ -945,12 +939,6 @@ void DOMWindow::focus(ScriptExecutionContext* context)
         return;
 
     m_frame->eventHandler()->focusDocumentView();
-#if ENABLE(TIZEN_ISF_PORT)
-    // If a frame was focused by JS event we try to show keyboard if frame is editable.
-    if (m_frame->editor() && m_frame->editor()->canEdit() && m_frame->editor()->client()) {
-        m_frame->editor()->client()->setInputMethodState(true);
-    }
-#endif
 }
 
 void DOMWindow::blur()
index 768ff51..32abbd7 100644 (file)
 
 namespace WebKit {
 
-#if ENABLE(TIZEN_ISF_PORT)
-// Define the input method hints
-enum _Ewk_Imh {
-    EWK_IMH_TELEPHONE = 1,
-    EWK_IMH_NUMBER,
-    EWK_IMH_EMAIL,
-    EWK_IMH_URL,
-    EWK_IMH_PASSWORD,
-    EWK_IMH_COLOR,
-    EWK_IMH_DATE,
-    EWK_IMH_DATETIME,
-    EWK_IMH_DATETIMELOCAL,
-    EWK_IMH_MONTH,
-    EWK_IMH_TIME,
-    EWK_IMH_WEEK
-};
-#endif
-
 struct EditorState {
     EditorState()
         : shouldIgnoreCompositionSelectionChange(false)
index 373e788..c48f94c 100755 (executable)
@@ -94,9 +94,6 @@ void GestureClient::endTap(const IntPoint& position)
     mouseDown.timestamp = timestamp;
     mouseDown.event_flags = EVAS_EVENT_FLAG_NONE;
     mouseDown.dev = 0;
-#if OS(TIZEN)
-    pageClientImpl->handleInputMethodMousePress();
-#endif
     pageClientImpl->page()->handleMouseEvent(NativeWebMouseEvent(&mouseDown, &viewPosition));
 
     // Send mouse up.
index 4c39ea5..aa98f6b 100755 (executable)
@@ -76,21 +76,20 @@ static void imfEventCommittedCb(void* client, Ecore_IMF_Context* context, void*
     static_cast<PageClientImpl*>(client)->imContextCommitted(static_cast<char*>(eventInfo));
 }
 
-static void imfInputPanelStateEventCb(void *client, Ecore_IMF_Context *ctx, int value)
+static void imfInputPanelStateEventCb(void *client, Ecore_IMF_Context *ctx, int state)
 {
     LOG(ISF, "%s\n", __func__);
 
     PageClientImpl* pageClient = static_cast<PageClientImpl*>(client);
-    if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
-        pageClient->setViewFocused(false);
+    if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
         pageClient->page()->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
         evas_object_smart_callback_call(pageClient->viewWidget(), "editorclient,ime,closed", 0);
         LOG(ISF, "[SIGNAL] editorclient,ime,closed\n");
+
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
         pageClient->setIsTextSelectionMode(false);
 #endif
-    }
-    else if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
+    } else if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
         pageClient->page()->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
         evas_object_smart_callback_call(pageClient->viewWidget(), "editorclient,ime,opened", 0);
         LOG(ISF, "[SIGNAL] editorclient,ime,opened\n");
@@ -142,7 +141,6 @@ PageClientImpl::PageClientImpl(WebContext* context, WebPageGroup* pageGroup, Eva
     , m_preventNextCompositionCommit(false)
     , m_layoutAndScaleState(BeforeCommitLoad)
     , m_inputMethod(0)
-    , m_inputMethodState(0)
     , m_mousePressed(0)
 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
     , m_visibleContentRect(IntRect())
@@ -165,10 +163,6 @@ PageClientImpl::PageClientImpl(WebContext* context, WebPageGroup* pageGroup, Eva
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
     , m_isContextMenuVisible(false)
 #endif
-#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-    , m_inputValue()
-    , m_inputType()
-#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
 #endif // #if OS(TIZEN)
 {
     m_page = context->createWebPage(this, pageGroup);
@@ -699,6 +693,12 @@ void PageClientImpl::didChangeScrollbarsForMainFrame() const
 void PageClientImpl::didStartProgress()
 {
     m_layoutAndScaleState = BeforeCommitLoad;
+#if ENABLE(TIZEN_ISF_PORT)
+    if (getInputMethodState()) {
+        LOG(ISF, "%s\n", __func__);
+        setInputMethodState(false, String(), String());
+    }
+#endif
 }
 
 void PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame()
@@ -840,110 +840,73 @@ void PageClientImpl::setInputMethodState(bool active, const AtomicString& inputT
 void PageClientImpl::setInputMethodState(bool active)
 #endif
 {
-    LOG(ISF, "%s active %d\n", __func__, active);
-
-    if (!m_inputMethod && !initializeInputMethod())
-        return;
-
-#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-    // FIXME: We need to find better way.
-    m_inputValue = inputValue;
-
-    m_inputType = inputType.string();
-#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-
 #if ENABLE(TIZEN_ISF_PORT)
-    Ewk_Setting* ewkSetting = ewk_view_setting_get(m_viewWidget);
-    bool autofocused = ewk_setting_show_ime_on_autofocus_get(ewkSetting);
-
-    if (!autofocused && active && !m_mousePressed) {
-        LOG(ISF, "Autofocus is disabled\n");
-        m_inputMethodState = false;
-        return;
-    }
-
-    m_inputMethodState = active;
-
-    LOG(ISF, "m_mousePressed %d, autofocused : %d, m_inputMethodState %d\n"
-           , m_mousePressed, autofocused, m_inputMethodState);
-
-    handleInputMethodState();
-#endif
-}
-
-#if ENABLE(TIZEN_ISF_PORT)
-void PageClientImpl::handleInputMethodState()
-{
     LOG(ISF, "%s\n", __func__);
 
     if (!m_inputMethod && !initializeInputMethod())
         return;
 
     Ewk_Setting* ewkSetting = ewk_view_setting_get(m_viewWidget);
+    bool autofocused = ewk_setting_show_ime_on_autofocus_get(ewkSetting);
     bool defaultKeypadEnabled = ewk_setting_enable_default_keypad_get(ewkSetting);
 
-    if (!evas_object_focus_get(m_viewWidget)) {
-        LOG(ISF, "evas_object_focus_get() failed\n");
-        m_inputMethodState = false;
+    LOG(ISF, "- active(%d), m_mousePressed(%d), autofocused(%d), defaultKeypadEnabled(%d)\n", active, m_mousePressed, autofocused, defaultKeypadEnabled);
+
+    if (!autofocused && active && !m_mousePressed) {
+        LOG(ISF, "[FAIL] Autofocus is disabled\n");
         return;
     }
 
     Ecore_IMF_Input_Panel_State state = ecore_imf_context_input_panel_state_get(m_inputMethod);
-    if (m_inputMethodState) {
+    if (active) {
 
         if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
             Eina_Rectangle rect;
             ecore_imf_context_input_panel_geometry_get(m_inputMethod, &rect.x, &rect.y, &rect.w, &rect.h);
             evas_object_smart_callback_call(m_viewWidget, "inputmethod,changed", &rect);
-            LOG(ISF, "[SIGNAL] inputmethod,changed\n");
+            LOG(ISF, "[SIGNAL] inputmethod,changed (%d,%d,%d,%d)\n", rect.x, rect.y, rect.w, rect.h);
         }
 
         if (!defaultKeypadEnabled) {
-            LOG(ISF, "Default keypad disabled\n");
-            m_inputMethodState = false;
+            LOG(ISF, "[FAIL] Default keypad disabled\n");
             return;
         }
 
-        const EditorState& editorState = page()->editorState();
-
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
+        String type = inputType.string();
+        LOG(ISF, "- Input type (%s)\n", type.utf8().data());
+
         // Input picker
-        if (m_inputType == "date") {
-            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATE, m_inputValue);
-            m_inputMethodState = false;
+        if (type == "date") {
+            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATE, inputValue);
             return;
-        } else if (m_inputType == "datetime") {
-            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIME, m_inputValue);
-            m_inputMethodState = false;
+        } else if (type == "datetime") {
+            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIME, inputValue);
             return;
-        } else if (m_inputType == "datetime-local") {
-            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIMELOCAL, m_inputValue);
-            m_inputMethodState = false;
+        } else if (type == "datetime-local") {
+            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_DATETIMELOCAL, inputValue);
             return;
-        } else if (m_inputType == "month") {
-            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_MONTH, m_inputValue);
-            m_inputMethodState = false;
+        } else if (type == "month") {
+            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_MONTH, inputValue);
             return;
-        } else if (m_inputType == "time") {
-            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_TIME, m_inputValue);
-            m_inputMethodState = false;
+        } else if (type == "time") {
+            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_TIME, inputValue);
             return;
-        } else if (m_inputType == "week") {
-            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_WEEK, m_inputValue);
-            m_inputMethodState = false;
+        } else if (type == "week") {
+            ewkViewInputPickerRequest(m_viewWidget, EWK_INPUT_TYPE_WEEK, inputValue);
             return;
         }
 
 #if ENABLE(TIZEN_DATALIST_ELEMENT)
         Vector<String> optionList = page()->getFocusedInputElementDataList();
         if (optionList.size() > 0) {
-            if (m_inputType == "tel")
+            if (type == "tel")
                 ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_TELEPHONE, optionList);
-            else if (m_inputType == "number")
+            else if (type == "number")
                 ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_NUMBER, optionList);
-            else if (m_inputType == "email")
+            else if (type == "email")
                 ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_EMAIL, optionList);
-            else if (m_inputType == "url")
+            else if (type == "url")
                 ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_URL, optionList);
             else
                 ewkViewDataListShowRequest(m_viewWidget, EWK_INPUT_TYPE_TEXT, optionList);
@@ -952,28 +915,26 @@ void PageClientImpl::handleInputMethodState()
         }
 #endif
 
-        LOG(ISF, "editorState.inputMethodHints %d, InputType %s\n", editorState.inputMethodHints, m_inputType.utf8().data());
-
         // Allow Prediction text
-        if (editorState.inputMethodHints == EWK_IMH_PASSWORD)
+        if (type == "password")
             ecore_imf_context_prediction_allow_set(m_inputMethod, false);
         else
             ecore_imf_context_prediction_allow_set(m_inputMethod, true);
 
         // Set Input Method's Layout
-        if (m_inputType == "tel")
+        if (type == "tel")
             ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER);
-        else if (m_inputType == "number")
+        else if (type == "number")
             ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER);
-        else if (m_inputType == "email")
+        else if (type == "email")
             ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL);
-        else if (m_inputType == "url")
+        else if (type == "url")
             ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_URL);
-        else if (m_inputType == "password")
+        else if (type == "password")
             ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD);
         else
             ecore_imf_context_input_panel_layout_set(m_inputMethod, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL);
-#endif
+#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
 
         Evas* evas = evas_object_evas_get(m_viewWidget);
         ecore_imf_context_client_window_set(m_inputMethod, (void*)ecore_evas_window_get(ecore_evas_ecore_evas_get(evas)));
@@ -981,20 +942,29 @@ void PageClientImpl::handleInputMethodState()
 
         ecore_imf_context_focus_in(m_inputMethod);
         ecore_imf_context_input_panel_show(m_inputMethod);
-        LOG(ISF, "[STATUS] SHOW\n");
+
+        setViewFocused(true);
+        evas_object_focus_set(m_viewWidget, true);
+        LOG(ISF, "- Keypad status : show\n");
 
         setCursorPosition();
-    } else if (!m_inputMethodState && state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
+    } else if (!active && state != ECORE_IMF_INPUT_PANEL_STATE_HIDE && evas_object_focus_get(m_viewWidget)) {
         if (!defaultKeypadEnabled) {
-            LOG(ISF, "Default keypad disabled\n");
+            LOG(ISF, "[FAIL] Default keypad disabled\n");
             return;
         }
+
+        ecore_imf_context_reset(m_inputMethod);
         ecore_imf_context_input_panel_hide(m_inputMethod);
         ecore_imf_context_focus_out(m_inputMethod);
-        LOG(ISF, "[STATUS] HIDE\n");
+
+        setViewFocused(false);
+        LOG(ISF, "- Keypad status : hide\n");
     }
+#endif // #if ENABLE(TIZEN_ISF_PORT)
 }
 
+#if ENABLE(TIZEN_ISF_PORT)
 void PageClientImpl::setCursorPosition(int preeditPosition)
 {
     LOG(ISF, "%s\n", __func__);
@@ -1020,7 +990,7 @@ bool PageClientImpl::initializeInputMethod()
         if (!m_inputMethod)
             return false;
 
-        ecore_imf_context_input_panel_enabled_set(m_inputMethod, EINA_FALSE);
+        ecore_imf_context_input_panel_enabled_set(m_inputMethod, false);
         ecore_imf_context_input_panel_event_callback_add(m_inputMethod, ECORE_IMF_INPUT_PANEL_STATE_EVENT, imfInputPanelStateEventCb, this);
         ecore_imf_context_retrieve_surrounding_callback_set(m_inputMethod, imfRetrieveSurroundingCb, this); // Support for Auto Capitalization
         ecore_imf_context_event_callback_add(m_inputMethod, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, imfContextDeleteSurroundingCb, this); //Support for Automatic Full Stop
@@ -1035,9 +1005,6 @@ bool PageClientImpl::getInputMethodState()
     if (!m_inputMethod && !initializeInputMethod())
         return false;
 
-    if (!page()->focusedFrame())
-        return false;
-
     Ecore_IMF_Input_Panel_State state;
     state = ecore_imf_context_input_panel_state_get(m_inputMethod);
     if (state != ECORE_IMF_INPUT_PANEL_STATE_HIDE)
@@ -1068,7 +1035,7 @@ void PageClientImpl::imContextCommitted(char* event)
     }
 
     page()->confirmComposition(String::fromUTF8(event));
-    LOG(ISF, "confirmComposition : %s\n", event);
+    LOG(ISF, "confirmComposition : (%s)\n", event);
 
     setCursorPosition();
 }
@@ -1132,28 +1099,15 @@ void PageClientImpl::handleInputMethodMousePress()
 {
     LOG(ISF, "%s\n", __func__);
 
-    m_mousePressed = true;
-
     if (!m_inputMethod && !initializeInputMethod())
         return;
 
-    if (!page()->focusedFrame())
-        return;
+    m_mousePressed = true;
 
     m_preventNextCompositionCommit = true;
-    ecore_imf_context_focus_out(m_inputMethod);
-}
-
-void PageClientImpl::handleInputMethodForFocusedNode()
-{
-    LOG(ISF, "%s\n", __func__);
-
-    if (!page()->focusedFrame())
-        return;
-
-    page()->handleInputMethodForFocusedNode();
+    ecore_imf_context_reset(m_inputMethod);
 }
-#endif
+#endif // #if ENABLE(TIZEN_ISF_PORT)
 
 void PageClientImpl::updateFormNavigation(int length, int offset)
 {
index 2c070ad..2f8a6c0 100755 (executable)
@@ -111,12 +111,9 @@ public:
 #endif
 #if ENABLE(TIZEN_ISF_PORT)
     void handleInputMethodMouseRelease();
-    void handleInputMethodState();
     void setCursorPosition(int preeditPosition = 0);
     bool getInputMethodState();
     bool initializeInputMethod();
-    bool isShowImeState() { return m_inputMethodState; }
-    void setImeState(bool state) { m_inputMethodState = state; }
 
     void imContextPreeditChanged();
     void imContextCommitted(char*);
@@ -124,7 +121,6 @@ public:
     void handleInputMethodKeydown();
     void handleInputMethodMousePress();
     Ecore_IMF_Context* getIMFContext() { return m_inputMethod; }
-    void handleInputMethodForFocusedNode();
 #endif
 
     void setViewFocused(bool focused) { m_viewFocused = focused; }
@@ -344,7 +340,6 @@ private:
     bool m_areFirstLayoutAndScaleInitialized;
 
     Ecore_IMF_Context* m_inputMethod;
-    bool m_inputMethodState;
     bool m_mousePressed;
     WebCore::IntRect m_focusedNodeRect;
 
@@ -382,11 +377,6 @@ private:
     bool m_isContextMenuVisible;
 #endif
 
-#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-    String m_inputValue;
-    String m_inputType;
-#endif // ENABLE(TIZEN_INPUT_TAG_EXTENSION)
-
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
     WebCore::Color m_bgColor;
 #endif
index 4ac70a3..df4bcd4 100755 (executable)
@@ -421,9 +421,6 @@ static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData)
     priv->pageClient->setViewFocused(true);
 #endif // #if OS(TIZEN)
     priv->pageClient->page()->viewStateDidChange(WebPageProxy::ViewIsFocused | WebPageProxy::ViewWindowIsActive);
-#if ENABLE(TIZEN_ISF_PORT)
-    priv->pageClient->handleInputMethodForFocusedNode();
-#endif
     return true;
 }
 
@@ -431,13 +428,13 @@ static Eina_Bool _ewk_view_smart_focus_out(Ewk_View_Smart_Data* smartData)
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 #if ENABLE(TIZEN_ISF_PORT)
-    Ecore_IMF_Context* imContext = priv->pageClient->getIMFContext();
-    Ecore_IMF_Input_Panel_State state = ecore_imf_context_input_panel_state_get(imContext);
-    if (imContext && state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
-        ecore_imf_context_input_panel_hide(imContext);
-        ecore_imf_context_focus_out(imContext);
-        priv->pageClient->setImeState(false);
-        LOG(ISF, "[STATUS] HIDE - focus_out\n");
+    // Keypad should be hidden rapidly when moving focus on elementary
+    // because Ecore-ime doesn't support it.
+    Ecore_IMF_Context* context = priv->pageClient->getIMFContext();
+    if (context && priv->pageClient->getInputMethodState()) {
+        LOG(ISF, "%s\n - keypad status : hide\n", __func__);
+        ecore_imf_context_input_panel_hide(context);
+        ecore_imf_context_focus_out(context);
     }
 #endif
 #if OS(TIZEN)
@@ -505,10 +502,6 @@ static Eina_Bool _ewk_view_smart_mouse_down(Ewk_View_Smart_Data* smartData, cons
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false)
 
-#if OS(TIZEN)
-    priv->pageClient->handleInputMethodMousePress();
-#endif // #if OS(TIZEN)
-
     Evas_Point position = {smartData->view.x, smartData->view.y};
     priv->pageClient->page()->handleMouseEvent(NativeWebMouseEvent(downEvent, &position));
     return true;
@@ -848,7 +841,6 @@ static void _ewk_view_on_touch_down(void* data, Evas* canvas, Evas_Object* ewkVi
             ecore_animator_del(priv->touchAnimator);
         priv->touchAnimator = ecore_animator_add(_ewk_view_touch_animator, smartData);
 #if OS(TIZEN)
-        priv->pageClient->handleInputMethodMousePress();
         evas_touch_point_list_nth_xy_get(canvas, 0, &priv->touchDownPoint.x, &priv->touchDownPoint.y);
         priv->exceedTouchMoveThreshold = false;
 #endif // #if OS(TIZEN)
index d7c9235..be441be 100755 (executable)
@@ -254,6 +254,7 @@ public:
     virtual void unlockOrientation() = 0;
 #endif
 #if ENABLE(TIZEN_ISF_PORT)
+    virtual void handleInputMethodMousePress() = 0;
     virtual bool getInputMethodState() = 0;
 #endif
 };
index 5fae5c5..19c4fc6 100755 (executable)
@@ -1041,6 +1041,11 @@ void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)
         hideContextMenu();
 #endif
 
+#if ENABLE(TIZEN_ISF_PORT)
+    if (event.type() == WebEvent::MouseDown)
+        m_pageClient->handleInputMethodMousePress();
+#endif
+
     if (m_shouldSendEventsSynchronously) {
         bool handled = false;
         process()->sendSync(Messages::WebPage::MouseEventSyncForTesting(event), Messages::WebPage::MouseEventSyncForTesting::Reply(handled), m_pageID);
index 2c8854f..7421d03 100755 (executable)
@@ -882,7 +882,6 @@ void recordingSurfaceSetEnableSet(bool enable);
     int getCursorOffsetPosition();
     String getContentOfPosition();
     bool deleteSurroundingPosition();
-    void handleInputMethodForFocusedNode();
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
index 274c56e..521b00f 100755 (executable)
@@ -243,14 +243,6 @@ void WebPageProxy::getInputMethodState(bool& state)
 {
      state = static_cast<PageClientImpl*>(m_pageClient)->getInputMethodState();
 }
-
-void WebPageProxy::handleInputMethodForFocusedNode()
-{
-    if (!isValid())
-        return;
-
-    process()->send(Messages::WebPage::HandleInputMethodForFocusedNode(), m_pageID);
-}
 #endif
 
 void WebPageProxy::requestUpdateFormNavigation()
index 71e1201..6facf47 100755 (executable)
@@ -501,42 +501,6 @@ EditorState WebPage::editorState() const
     result.hasComposition = frame->editor()->hasComposition();
     result.shouldIgnoreCompositionSelectionChange = frame->editor()->ignoreCompositionSelectionChange();
 
-#if ENABLE(TIZEN_ISF_PORT)
-    if (frame
-        && frame->document()
-        && frame->document()->focusedNode()
-        && frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) {
-
-        WebCore::HTMLInputElement* inputElement;
-        inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode());
-
-        if (inputElement) {
-            if (inputElement->isTelephoneField())
-                result.inputMethodHints = EWK_IMH_TELEPHONE;
-            else if (inputElement->isNumberField())
-                result.inputMethodHints = EWK_IMH_NUMBER;
-            else if (inputElement->isEmailField())
-                result.inputMethodHints = EWK_IMH_EMAIL;
-            else if (inputElement->isURLField())
-                result.inputMethodHints = EWK_IMH_URL;
-            else if (inputElement->isPasswordField())
-                result.inputMethodHints = EWK_IMH_PASSWORD;
-            else if (inputElement->isDateField())
-                result.inputMethodHints = EWK_IMH_DATE;
-            else if (inputElement->isDateTimeField())
-                result.inputMethodHints = EWK_IMH_DATETIME;
-            else if (inputElement->isDateTimeLocalField())
-                result.inputMethodHints = EWK_IMH_DATETIMELOCAL;
-            else if (inputElement->isMonthField())
-                result.inputMethodHints = EWK_IMH_MONTH;
-            else if (inputElement->isTimeField())
-                result.inputMethodHints = EWK_IMH_TIME;
-            else if (inputElement->isWeekField())
-                result.inputMethodHints = EWK_IMH_WEEK;
-        }
-    }
-#endif
-
 #if PLATFORM(QT)
     size_t location = 0;
     size_t length = 0;
index 238bb17..568dcb2 100755 (executable)
@@ -219,7 +219,6 @@ public:
     void getCursorOffsetPosition(int& offset);
     void getContentOfPosition(String& content);
     void deleteSurroundingPosition(bool& result);
-    void handleInputMethodForFocusedNode();
 #endif
     void scrollMainFrameBy(const WebCore::IntSize&);
     void scrollMainFrameTo(const WebCore::IntPoint&);
index b04374b..1958f71 100755 (executable)
@@ -333,7 +333,6 @@ messages -> WebPage {
     GetCursorOffsetPosition() -> (int offset)
     GetContentOfPosition() -> (String offset)
     DeleteSurroundingPosition() -> (bool result);
-    HandleInputMethodForFocusedNode();
 #endif
 #endif
 #if PLATFORM(QT)
index 67e1ff5..ef09c8b 100755 (executable)
@@ -549,15 +549,6 @@ void WebPage::deleteSurroundingPosition(bool& result)
 
     frame->editor()->deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
 }
-
-void WebPage::handleInputMethodForFocusedNode()
-{
-    Frame* frame = m_page->focusController()->focusedOrMainFrame();
-    if (frame
-        && frame->document()
-        && frame->document()->focusedNode())
-        corePage()->editorClient()->setInputMethodState(frame->document()->focusedNode()->shouldUseInputMethod());
-}
 #endif
 
 #if ENABLE(TIZEN_INPUT_TAG_EXTENSION)