From: SangYong Park Date: Wed, 3 Apr 2013 12:51:40 +0000 (+0900) Subject: Fix ime issues X-Git-Tag: 2.1_release~218 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b71842410d84dba6f3ca219476a2e7f3dd4919d3;p=framework%2Fweb%2Fwebkit-efl.git Fix ime issues [Title] Fix ime issues [Issue#] N/A [Problem] Keypad did not showing when edit field has focus. [Cause] It is side-effect by showing by editorState as opensource [Solution] Change invalid code Change-Id: I8e968d05a014f8c8acb2ad288604995f7395c2d2 --- diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index 5fb8017..2f93bec 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -530,11 +530,11 @@ static Eina_Bool _ewk_view_smart_gesture_end(Ewk_View_Smart_Data* smartData, con if (impl->pageClient->isDragMode()) impl->pageClient->setDragMode(false); #endif - impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y)); #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) if (impl->pageClient->isTextSelectionMode()) impl->pageClient->setIsTextSelectionMode(false); #endif + impl->gestureClient->endTap(IntPoint(event->position.x, event->position.y)); #if ENABLE(TIZEN_ISF_PORT) evas_object_focus_set(smartData->self, true); #endif diff --git a/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp index d7f993d..82e0ecc 100755 --- a/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp +++ b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp @@ -55,9 +55,11 @@ void InputMethodContextEfl::onIMFInputPanelStateChanged(void* data, Ecore_IMF_Co if (!inputMethodContext->m_viewImpl->page()->focusedFrame() || !inputMethodContext->m_focused) return; - if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) + if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "editorclient,ime,closed", 0); - else if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) + if (inputMethodContext->m_context) + evas_object_focus_set(inputMethodContext->m_viewImpl->view(), false); + } else if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) evas_object_smart_callback_call(inputMethodContext->m_viewImpl->view(), "editorclient,ime,opened", 0); } @@ -398,17 +400,19 @@ void InputMethodContextEfl::updateTextInputState() setType(editor.inputMethodHints); - if (!hasFocus) + if (!hasFocus) { + m_focused = true; return; - - // input field zoom for external keyboard - ewk_view_focused_node_adjust(m_viewImpl->view(), EINA_TRUE); + } #endif ecore_imf_context_reset(m_context.get()); ecore_imf_context_focus_in(m_context.get()); #if ENABLE(TIZEN_ISF_PORT) ecore_imf_context_input_panel_show(m_context.get()); + + // input field zoom for external keyboard + ewk_view_focused_node_adjust(m_viewImpl->view(), EINA_TRUE); #endif m_focused = true; } else { @@ -515,7 +519,8 @@ void InputMethodContextEfl::revertIMFContext() return; PassOwnPtr imfContext = m_context.release(); - m_contextList.add(ecore_imf_context_input_panel_layout_get(imfContext.get()), imfContext); + int layout = ecore_imf_context_input_panel_layout_get(imfContext.get()); + m_contextList.add(layout, imfContext); } void InputMethodContextEfl::resetIMFContext() @@ -524,9 +529,6 @@ void InputMethodContextEfl::resetIMFContext() return; ecore_imf_context_reset(m_context.get()); - - if (ecore_imf_context_input_panel_state_get(m_context.get()) == ECORE_IMF_INPUT_PANEL_STATE_HIDE) - revertIMFContext(); } void InputMethodContextEfl::hideIMFContext() diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 3921a5e..05f5572 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -564,9 +564,13 @@ EditorState WebPage::editorState() const result.shouldIgnoreCompositionSelectionChange = frame->editor()->ignoreCompositionSelectionChange(); #if ENABLE(TIZEN_ISF_PORT) - Element* selectionRoot = frame->selection()->rootEditableElement(); + Element* selectionRoot = frame->selection()->rootEditableElementOrDocumentElement(); + if (!selectionRoot) + return result; + + Node* hostNode = selectionRoot->shadowAncestorNode(); if (result.isContentEditable) { - HTMLTextFormControlElement* formControl = toTextFormControl(selectionRoot); + HTMLTextFormControlElement* formControl = toTextFormControl(hostNode); if (formControl) { result.inputMethodHints = formControl->type(); result.surroundingText = formControl->value(); @@ -580,8 +584,7 @@ EditorState WebPage::editorState() const #endif #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) - if (selectionRoot) - result.editorRect = frame->view()->contentsToWindow(selectionRoot->getPixelSnappedRect()); + result.editorRect = frame->view()->contentsToWindow(selectionRoot->getPixelSnappedRect()); #endif #if PLATFORM(QT)