[WK2] Focus on input tag having a label tag
authorSeokju Kwon <seokju.kwon@samsung.com>
Sat, 8 Sep 2012 09:15:24 +0000 (18:15 +0900)
committerSeokju Kwon <seokju.kwon@samsung.com>
Sat, 8 Sep 2012 11:26:19 +0000 (20:26 +0900)
[Title] Focus on input tag having a label tag (www.tizen.org)
[Issue#] N/A
[Problem] Keypad doesn't appear when clicking an input tag
[Cause] Node under the mouse is label tag
[Solution] Check wheather mouse is pressed or not in dispatchFocusEvent

Change-Id: Ibadf925d46fc0c07ef8dfacbe84832b33078becc

Source/WebCore/dom/Node.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp

index f1768bf..c10a64e 100644 (file)
@@ -2807,6 +2807,10 @@ void Node::dispatchFocusEvent(PassRefPtr<Node> oldFocusedNode)
         document()->page()->chrome()->client()->elementDidFocus(this);
 
 #if ENABLE(TIZEN_ISF_PORT)
+    if (this->shouldUseInputMethod() && document()->frame()
+        && document()->frame()->eventHandler()->mousePressed())
+        document()->frame()->editor()->client()->handleInputMethodMousePress();
+
     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);
index 6b82030..06700c5 100644 (file)
 #include "HTMLPlugInElement.h"
 #endif
 
-#if ENABLE(TIZEN_ISF_PORT)
-#include "EditorClient.h"
-#endif
-
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -2370,10 +2366,6 @@ 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 1e77d10..3674bd1 100644 (file)
@@ -619,8 +619,10 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra
 #if ENABLE(TIZEN_WEBKIT_PASTEBOARD)
             && m_page->selection().selectionType() != VisibleSelection::RangeSelection
 #endif // ENABLE(TIZEN_WEBKIT_PASTEBOARD)
-            )
+            ) {
+            m_page->editorClient()->handleInputMethodMousePress();
             m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod());
+        }
         return true;
     }
 #else