Fix focus ui navigation bug
authorSangYong Park <sy302.park@samsung.com>
Tue, 1 Oct 2013 08:16:45 +0000 (17:16 +0900)
committerSangYong Park <sy302.park@samsung.com>
Tue, 1 Oct 2013 08:21:20 +0000 (17:21 +0900)
[Title] Fix focus ui navigation bug
[Issue#] N_SE-51901
[Problem] Focus ui has minor navigation bugs
[Cause] Do not considered navigation by keyboard.
[Solution] Fix invalid code.

Change-Id: I102f662ef79fb059ed60f3cf27853ef05b4afc6d

Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index 40ddb38..f982722 100755 (executable)
@@ -3503,6 +3503,10 @@ bool EventHandler::tabsToLinks(KeyboardEvent* event) const
 {
     // FIXME: This function needs a better name. It can be called for keypresses other than Tab when spatial navigation is enabled.
 
+#if ENABLE(TIZEN_FOCUS_UI)
+    return isSpatialNavigationEnabled(m_frame);
+#endif
+
     Page* page = m_frame->page();
     if (!page)
         return false;
index 3379564..5bfac9f 100755 (executable)
@@ -347,6 +347,9 @@ bool FocusController::advanceFocusInDocumentOrder(FocusDirection direction, Keyb
             document->setFocusedNode(0);
             setFocusedFrame(0);
             m_page->chrome()->takeFocus(direction);
+#if ENABLE(TIZEN_FOCUS_UI)
+            frame->selection()->clear();
+#endif
             return true;
         }
 
index c195e6f..854239e 100755 (executable)
@@ -1929,7 +1929,13 @@ void WebPage::setSpatialNavigationEnabled(bool enabled)
     if (m_focusedNode && m_focusedNode->renderer())
         m_focusedNode->renderer()->repaint();
 
-    if (!enabled)
+    if (enabled) {
+        Frame* frame = m_page->focusController()->focusedOrMainFrame();
+        if (frame) {
+            PlatformMouseEvent fakeMouseMove(IntPoint(-1, -1), IntPoint(-1, -1), NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
+            frame->eventHandler()->mouseMoved(fakeMouseMove);
+        }
+    } else
         setFocusedNode(0);
 }
 #endif