[WK2] fail to disable autofocus for ime
authorSeokju Kwon <seokju.kwon@samsung.com>
Fri, 7 Sep 2012 11:20:46 +0000 (20:20 +0900)
committerSeokju Kwon <seokju.kwon@samsung.com>
Fri, 7 Sep 2012 12:00:57 +0000 (21:00 +0900)
[Title] fail to disable autofocus for ime
[Issue#] N/A
[Problem] keypad show up and down rapidly
[Cause] Can't recognize whether mouse is pressed or not
[Solution] Check it in EventHandler::dispatchMouseEvent

Change-Id: Ie33e35061950ee78cc825fc71dde4b80bf9f0a35

Source/WebCore/dom/Element.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
Source/WebKit2/WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp

index e8f8319..986230f 100644 (file)
 #include "SVGNames.h"
 #endif
 
-#if ENABLE(TIZEN_ISF_PORT)
-#include "Logging.h"
-#endif
-
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -1571,13 +1567,6 @@ void Element::focus(bool restorePreviousSelection)
 
     RefPtr<Node> protect;
     if (Page* page = doc->page()) {
-#if ENABLE(TIZEN_ISF_PORT)
-        // FIXME : Web need to find a better way
-        if (!page->settings()->showImeOnAutofocus()) {
-            LOG(ISF, "[FAIL] %s : Autofocus is failed\n", __func__);
-            return;
-        }
-#endif
         // Focus and change event handlers can cause us to lose our last ref.
         // If a focus event handler changes the focus to a different node it
         // does not make sense to continue and update appearence.
index 7754555..6378d58 100644 (file)
@@ -310,6 +310,14 @@ void Chrome::runJavaScriptAlert(Frame* frame, const String& message)
     if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::AlertDialog, message))
         return;
 
+#if ENABLE(TIZEN_ISF_PORT)
+    Node* node = frame ? frame->document()->focusedNode() : 0;
+    if (node
+        && node->nodeType() == Node::ELEMENT_NODE
+        && node->hasTagName(HTMLNames::inputTag))
+        static_cast<HTMLInputElement*>(node)->blur();
+#endif
+
     // Defer loads in case the client method runs a new event loop that would
     // otherwise cause the load to continue while we're in the middle of executing JavaScript.
     PageGroupLoadDeferrer deferrer(m_page, true);
index 06700c5..6b82030 100644 (file)
 #include "HTMLPlugInElement.h"
 #endif
 
+#if ENABLE(TIZEN_ISF_PORT)
+#include "EditorClient.h"
+#endif
+
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -2366,6 +2370,10 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
         // if the page already set it (e.g., by canceling default behavior).
         if (Page* page = m_frame->page()) {
             if (node && node->isMouseFocusable()) {
+#if ENABLE(TIZEN_ISF_PORT)
+                if (node && node->shouldUseInputMethod())
+                    m_frame->editor()->client()->handleInputMethodMousePress();
+#endif
                 if (!page->focusController()->setFocusedNode(node, m_frame))
                     swallowEvent = true;
             } else if (!node || !node->focused()) {
index ef96e9e..5a2f499 100755 (executable)
@@ -258,7 +258,6 @@ public:
     virtual void unlockOrientation() = 0;
 #endif
 #if ENABLE(TIZEN_ISF_PORT)
-    virtual void handleInputMethodMousePress() = 0;
     virtual bool getInputMethodState() = 0;
 #endif
 };
index 87f7110..0014992 100755 (executable)
@@ -1038,11 +1038,6 @@ 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 f377a15..4896c46 100755 (executable)
@@ -890,6 +890,7 @@ void recordingSurfaceSetEnableSet(bool enable);
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
+    void handleInputMethodMousePress();
     void handleInputMethodMouseRelease();
     void updateCursorPosition();
     int getCursorOffsetPosition();
index 29951c2..abbefb7 100755 (executable)
@@ -294,6 +294,7 @@ messages -> WebPageProxy {
     SetInputMethodState(bool active, AtomicString inputType, WTF::String inputValue);
 #endif
 #if ENABLE(TIZEN_ISF_PORT)
+    HandleInputMethodMousePress()
     HandleInputMethodMouseRelease()
     UpdateCursorPosition()
     GetInputMethodState() -> (bool state)
index 62e8393..235cdf1 100755 (executable)
@@ -196,6 +196,11 @@ void WebPageProxy::setInputMethodState(bool active)
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
+void WebPageProxy::handleInputMethodMousePress()
+{
+    static_cast<PageClientImpl*>(m_pageClient)->handleInputMethodMousePress();
+}
+
 void WebPageProxy::handleInputMethodMouseRelease()
 {
     static_cast<PageClientImpl*>(m_pageClient)->handleInputMethodMouseRelease();
index 56f7288..448902c 100644 (file)
@@ -130,7 +130,7 @@ private:
 
     TextCheckerClient* textChecker()  OVERRIDE { return this; }
 #if ENABLE(TIZEN_ISF_PORT)
-    virtual void handleInputMethodMousePress() OVERRIDE {} 
+    virtual void handleInputMethodMousePress() OVERRIDE;
     virtual void handleInputMethodMouseRelease() OVERRIDE;
     virtual bool getInputMethodState() OVERRIDE;
 #endif
index 38a5b81..1e51a2e 100644 (file)
@@ -84,6 +84,11 @@ void WebEditorClient::writeDataToClipboardWithType(const String& data, Pasteboar
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
+void WebEditorClient::handleInputMethodMousePress()
+{
+    m_page->send(Messages::WebPageProxy::HandleInputMethodMousePress());
+}
+
 void WebEditorClient::handleInputMethodMouseRelease()
 {
     m_page->send(Messages::WebPageProxy::HandleInputMethodMouseRelease());