else
selectComposition();
+#if ENABLE(TIZEN_ISF_PORT)
+ if (m_frame->selection()->isNone() && mode != CancelComposition) {
+#else
if (m_frame->selection()->isNone()) {
+#endif
setIgnoreCompositionSelectionChange(false);
return;
}
#include "VisiblePosition.h"
#include <wtf/unicode/CharacterNames.h>
+#if ENABLE(TIZEN_ISF_PORT)
+#include "EditorClient.h"
+#endif
+
using namespace std;
namespace WebCore {
return;
RenderBlock* innerTextRenderer = toRenderBlock(innerText->renderer());
if (innerTextRenderer) {
+#if ENABLE(TIZEN_ISF_PORT)
+ EUserModify userModify = innerTextRenderer->style()->userModify();
+#endif
// We may have set the width and the height in the old style in layout().
// Reset them now to avoid getting a spurious layout hint.
innerTextRenderer->style()->setHeight(Length());
innerTextRenderer->style()->setWidth(Length());
innerTextRenderer->setStyle(createInnerTextStyle(style()));
innerText->setNeedsStyleRecalc();
+#if ENABLE(TIZEN_ISF_PORT)
+ if (userModify != innerTextRenderer->style()->userModify() && frame()->editor()->client())
+ frame()->editor()->client()->respondToChangedSelection(frame());
+#endif
}
textFormControlElement()->updatePlaceholderVisibility(false);
}
{
if (!evas_object_focus_get(m_viewImpl->view())) {
InputMethodContextEfl* inputMethodContext = m_viewImpl->inputMethodContext();
- if (inputMethodContext && !inputMethodContext->isShow())
+ if (inputMethodContext)
inputMethodContext->hideIMFContext();
evas_object_focus_set(m_viewImpl->view(), true);
if (!isValid())
return;
-#if ENABLE(TIZEN_ISF_PORT)
- if (event.type() == WebEvent::GestureSingleTap)
- EwkViewImpl::fromEvasObject(viewWidget())->inputMethodContext()->resetIMFContext();
-#endif
-
#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
if (!isWaitingForJavaScriptPopupReply()) {
m_gestureEventQueue.append(event);
, m_context(context)
, m_focused(false)
#if ENABLE(TIZEN_ISF_PORT)
- , m_tryToShow(false)
+ , m_useInputMethod(false)
, m_state(ECORE_IMF_INPUT_PANEL_STATE_HIDE)
#endif
{
*isFiltered = ecore_imf_context_filter_event(m_context.get(), ECORE_IMF_EVENT_KEY_DOWN, &inputMethodEvent);
}
+#if ENABLE(TIZEN_ISF_PORT)
void InputMethodContextEfl::updateTextInputState()
{
-#if !ENABLE(TIZEN_ISF_PORT)
- if (!m_context)
- return;
-#endif
-
const EditorState& editor = m_viewImpl->page()->editorState();
-#if ENABLE(TIZEN_ISF_PORT)
- bool isActive = !editor.selectionIsNone && (editor.isContentEditable || m_tryToShow);
-#else
- bool isActive = editor.isContentEditable;
-#endif
+ if (m_focused)
+ ecore_imf_context_cursor_position_set(m_context.get(), editor.cursorPosition);
- if (isActive) {
-#if ENABLE(TIZEN_ISF_PORT)
- if (m_context)
- ecore_imf_context_cursor_position_set(m_context.get(), editor.cursorPosition);
-#endif
+ if (editor.shouldIgnoreCompositionSelectionChange)
+ return;
+ if (editor.isContentEditable && m_useInputMethod) {
if (m_focused)
return;
-#if ENABLE(TIZEN_ISF_PORT)
Ewk_Settings* settings = ewk_view_settings_get(m_viewImpl->view());
bool defaultKeypadEnabled = ewk_settings_default_keypad_enabled_get(settings);
m_focused = true;
return;
}
-#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
+ hideIMFContext();
+}
+#else
+void InputMethodContextEfl::updateTextInputState()
+{
+ if (!m_context)
+ return;
+
+ const EditorState& editor = m_viewImpl->page()->editorState();
+
+ if (editor.isContentEditable) {
+ if (m_focused)
+ return;
+
+ ecore_imf_context_reset(m_context.get());
+ ecore_imf_context_focus_in(m_context.get());
m_focused = true;
} else {
if (!m_focused)
m_focused = false;
ecore_imf_context_reset(m_context.get());
ecore_imf_context_focus_out(m_context.get());
-#if ENABLE(TIZEN_ISF_PORT)
- ecore_imf_context_input_panel_hide(m_context.get());
- revertIMFContext();
-#endif
}
}
+#endif
#if ENABLE(TIZEN_ISF_PORT)
void InputMethodContextEfl::initializeIMFContext(Ecore_IMF_Context* context, Ecore_IMF_Input_Panel_Layout layout)
ecore_imf_context_input_panel_layout_set(m_context.get(), layout);
}
+void InputMethodContextEfl::setUseInputMethod(bool use)
+{
+ m_useInputMethod = use;
+ updateTextInputState();
+}
+
void InputMethodContextEfl::setType(const String& type)
{
Ecore_IMF_Input_Panel_Layout layout;
void InputMethodContextEfl::hideIMFContext()
{
- if (!m_context)
+ if (!m_context || !m_focused)
return;
+ if (m_viewImpl->page()->editorState().hasComposition)
+ m_viewImpl->page()->cancelComposition();
+
+ m_focused = false;
+
if (ecore_imf_context_input_panel_state_get(m_context.get()) != ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
ecore_imf_context_reset(m_context.get());
ecore_imf_context_input_panel_hide(m_context.get());
void updateTextInputState();
#if ENABLE(TIZEN_ISF_PORT)
- void setTryToShow(bool flag) { m_tryToShow = flag; }
- void setType(const String&);
+ void setUseInputMethod(bool);
bool isShow();
Ecore_IMF_Autocapital_Type autoCapitalType();
void onFocusIn();
void onFocusOut();
- void revertIMFContext();
void resetIMFContext();
void hideIMFContext();
- void destroyIMFContextList();
- bool isIMEPostion(int x, int y);
- void setState(int state) { m_state = state; }
- void setIMERect(const WebCore::IntRect& rect) { m_imeRect = rect; }
+ bool isIMEPostion(int, int);
#endif
private:
static void onIMFInputSequenceComplete(void* data, Ecore_IMF_Context*, void* eventInfo);
static void onIMFPreeditSequenceChanged(void* data, Ecore_IMF_Context*, void* eventInfo);
- EwkViewImpl* m_viewImpl;
- OwnPtr<Ecore_IMF_Context> m_context;
- bool m_focused;
-
#if ENABLE(TIZEN_ISF_PORT)
void initializeIMFContext(Ecore_IMF_Context*, Ecore_IMF_Input_Panel_Layout);
static Eina_Bool onIMFRetrieveSurrounding(void*, Ecore_IMF_Context*, char**, int*);
static void onIMFDeleteSurrounding(void*, Ecore_IMF_Context*, void*);
+ void setType(const String&);
+ void revertIMFContext();
+ void destroyIMFContextList();
+ void setState(int state) { m_state = state; }
+ void setIMERect(const WebCore::IntRect& rect) { m_imeRect = rect; }
+
#if ENABLE(TIZEN_INPUT_TAG_EXTENSION)
void showInputPicker(Ewk_Input_Type, const EditorState&);
#endif
+#endif
+ EwkViewImpl* m_viewImpl;
+ OwnPtr<Ecore_IMF_Context> m_context;
+ bool m_focused;
+
+#if ENABLE(TIZEN_ISF_PORT)
HashMap<int, OwnPtr<Ecore_IMF_Context> > m_contextList;
- bool m_tryToShow;
+ bool m_useInputMethod;
int m_state;
WebCore::IntRect m_imeRect;
#endif
void WebPageProxy::setInputMethodState(bool active)
{
InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
- if (!active)
+ if (!inputMethodContext)
return;
- inputMethodContext->setTryToShow(true);
- inputMethodContext->updateTextInputState();
- inputMethodContext->setTryToShow(false);
+ inputMethodContext->setUseInputMethod(active);
}
int WebPageProxy::getCursorOffset()
OwnPtr<ScreenReader> m_screenReader;
#endif
-#if ENABLE(TIZEN_ISF_PORT)
- bool m_isSettingComposition;
-#endif
-
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
EditorState m_editorState;
#endif
WebCore::provideDeviceMotionTo(m_page.get(), new DeviceMotionClientTizen);
WebCore::provideDeviceOrientationTo(m_page.get(), new DeviceOrientationClientTizen);
#endif
-#if ENABLE(TIZEN_ISF_PORT)
- m_isSettingComposition = false;
-#endif
}
#if ENABLE(TIZEN_PREFERENCE)
}
}
}
- m_isSettingComposition = true;
#endif
targetFrame->editor()->setComposition(compositionString, underlines, cursorPosition, 0);
-
-#if ENABLE(TIZEN_ISF_PORT)
- m_isSettingComposition = false;
-#endif
}
void WebPage::cancelComposition()
#if ENABLE(TIZEN_ISF_PORT)
void WebPage::didCancelComposition(Node* valueChangedNode)
{
- if (m_isSettingComposition)
- return;
-
Frame* frame = m_page->focusController()->focusedOrMainFrame();
- if (!frame || !valueChangedNode->containsIncludingShadowDOM(frame->editor()->compositionNode()))
+ if (!frame || frame->editor()->ignoreCompositionSelectionChange() || !valueChangedNode->containsIncludingShadowDOM(frame->editor()->compositionNode()))
return;
frame->editor()->cancelComposition();
VisiblePosition visiblePos(frameSelection->extent());
if (visiblePos.isNull())
return;
- VisibleSelection newSelection = VisibleSelection(visiblePos);
- frameSelection->setSelection(newSelection, CharacterGranularity);
+
+ focusedFrame->editor()->setIgnoreCompositionSelectionChange(true);
+ frameSelection->setSelection(VisibleSelection(visiblePos), CharacterGranularity);
+ focusedFrame->editor()->setIgnoreCompositionSelectionChange(false);
+
frameSelection->setCaretBlinkingSuspended(false);
} else
selectionClearAllSelection(m_page->mainFrame());