Remove focus ring from unfocusable element
authorSangYong Park <sy302.park@samsung.com>
Tue, 8 Oct 2013 05:45:20 +0000 (14:45 +0900)
committerSangYong Park <sy302.park@samsung.com>
Tue, 8 Oct 2013 06:03:03 +0000 (15:03 +0900)
[Title] Remove focus ring from unfocusable element.
[Issue#] N_SE-54263
[Problem] Focus ring appeared on unfocusable element.
[Cause] Show focus ring forcely when focus ui mode was enabled.
[Solution] Initialize focused node when focus ui mode was enabled.

Change-Id: I8d07c9b7b00bd33be3d5aff24dd35138c33fe696

Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index 5e1ef7f..f10ceae 100755 (executable)
@@ -4398,7 +4398,7 @@ Eina_Bool ewk_view_feed_touch_event(Evas_Object* ewkView, Ewk_Touch_Event_Type t
 
 #if ENABLE(TIZEN_FOCUS_UI)
     if (type == EWK_TOUCH_START)
-        impl->page()->setSpatialNavigationEnabled(false);
+        impl->page()->setFocusUIEnabled(false);
 #endif
 
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) && ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)
index 861959a..7e86e85 100755 (executable)
@@ -265,7 +265,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
     , m_contentSuspendedByInspector(false)
 #endif
 #if ENABLE(TIZEN_FOCUS_UI)
-    , m_spatialNavigationEnabled(false)
+    , m_focusUIEnabled(false)
 #endif
 {
 #ifndef NDEBUG
index f7510d3..50eb437 100755 (executable)
@@ -1058,7 +1058,7 @@ public:
 #endif
 
 #if ENABLE(TIZEN_FOCUS_UI)
-    void setSpatialNavigationEnabled(bool);
+    void setFocusUIEnabled(bool);
 #endif
 
 private:
@@ -1707,7 +1707,7 @@ private:
 #endif
 
 #if ENABLE(TIZEN_FOCUS_UI)
-    bool m_spatialNavigationEnabled;
+    bool m_focusUIEnabled;
 #endif
 };
 
index af86d29..100aa93 100755 (executable)
@@ -74,7 +74,7 @@ Eina_Bool InputMethodContextEfl::windowPropertyChanged(void*, int, void* event)
             EwkViewImpl::pages(pages);
 
             for (size_t i = 0; i < pages.size(); ++i)
-                pages[i]->setSpatialNavigationEnabled(false);
+                pages[i]->setFocusUIEnabled(false);
         }
 #endif
     } else {
@@ -416,7 +416,7 @@ void InputMethodContextEfl::handleKeyDownEvent(const Evas_Event_Key_Down* downEv
 {
 #if ENABLE(TIZEN_FOCUS_UI)
     if (s_shouldUseExternalKeyboard && strncmp(downEvent->keyname, "XF86", 4))
-        m_viewImpl->page()->setSpatialNavigationEnabled(true);
+        m_viewImpl->page()->setFocusUIEnabled(true);
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
@@ -646,7 +646,7 @@ void InputMethodContextEfl::onFocusOut()
 #endif
 
 #if ENABLE(TIZEN_FOCUS_UI)
-    m_viewImpl->page()->setSpatialNavigationEnabled(false);
+    m_viewImpl->page()->setFocusUIEnabled(false);
 #endif
 
     if (!m_context || !m_focused)
index 727575a..c198f2c 100755 (executable)
@@ -1064,7 +1064,7 @@ void WebPageProxy::didChangeFocusedRects(const Vector<IntRect>& rects)
         canUpdate |= ScreenReaderProxy::screenReader().isActive(viewImpl);
 #endif
 #if ENABLE(TIZEN_FOCUS_UI)
-        canUpdate |= m_spatialNavigationEnabled;
+        canUpdate |= m_focusUIEnabled;
 #endif
 
         if (canUpdate)
@@ -1262,19 +1262,19 @@ void WebPageProxy::setContentSuspendedByInspector(bool isSuspended)
 #endif
 
 #if ENABLE(TIZEN_FOCUS_UI)
-void WebPageProxy::setSpatialNavigationEnabled(bool enabled)
+void WebPageProxy::setFocusUIEnabled(bool enabled)
 {
-    if (m_spatialNavigationEnabled == enabled)
+    if (m_focusUIEnabled == enabled)
         return;
 
-    m_spatialNavigationEnabled = enabled;
+    m_focusUIEnabled = enabled;
 
     if (enabled)
         static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->focusRing()->setImage(FOCUS_UI_FOCUS_RING_IMAGE_PATH, 4, 2);
     else
         static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->focusRing()->setImage(String(), 0, 0);
 
-    process()->send(Messages::WebPage::SetSpatialNavigationEnabled(enabled), m_pageID);
+    process()->send(Messages::WebPage::SetFocusUIEnabled(enabled), m_pageID);
 }
 #endif
 } // namespace WebKit
index 0701649..16afee0 100755 (executable)
@@ -849,7 +849,7 @@ public:
 #endif
 
 #if ENABLE(TIZEN_FOCUS_UI)
-    void setSpatialNavigationEnabled(bool);
+    void setFocusUIEnabled(bool);
 #endif
 
 private:
index e4db491..107b796 100755 (executable)
@@ -460,6 +460,6 @@ messages -> WebPage {
 #endif
 
 #if ENABLE(TIZEN_FOCUS_UI)
-    SetSpatialNavigationEnabled(bool enabled)
+    SetFocusUIEnabled(bool enabled)
 #endif
 }
index db92988..33dc00c 100644 (file)
@@ -1936,7 +1936,7 @@ void WebPage::didChangeContents()
 }
 
 #if ENABLE(TIZEN_FOCUS_UI)
-void WebPage::setSpatialNavigationEnabled(bool enabled)
+void WebPage::setFocusUIEnabled(bool enabled)
 {
     m_page->settings()->setSpatialNavigationEnabled(enabled);
 
@@ -1949,6 +1949,7 @@ void WebPage::setSpatialNavigationEnabled(bool enabled)
             PlatformMouseEvent fakeMouseMove(IntPoint(-1, -1), IntPoint(-1, -1), NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime());
             frame->eventHandler()->mouseMoved(fakeMouseMove);
         }
+        setFocusedNode(frame && frame->document() ? frame->document()->focusedNode() : 0);
     } else
         setFocusedNode(0);
 }