Fixed sometimes foucs ring disappear late and is not shown.
authorYuni Jeong <yhnet.jung@samsung.com>
Thu, 27 Jun 2013 17:46:37 +0000 (02:46 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 10 Jul 2013 03:08:46 +0000 (03:08 +0000)
[Title] Fixed sometimes foucs ring disappear late and is not shown.
[Issue#] N/A
[Problem]
1. Sometimes focus ring disappear after loading new page.
2. Sometimes focus ring is not shown.
[Cause]
1. After new page was loaded, timer for hidding focus ring expire.
   So, focus ring disappear late.
2. After new page was loaded, timer for showing focus ring expire.
   And then, to getting focus ring node is performed at new page.
[Solution]
1. When new load is commited, added code to hide focus ring immediately.
2. If focus ring is not showing just before tap is performed,
   added code to show focus ring immediately.

Change-Id: I9e65f9dc8231038722ec45995a5207880fd76035

Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.cpp
Source/WebKit2/UIProcess/API/efl/tizen/FocusRing.h
Source/WebKit2/UIProcess/WebPageProxy.cpp

index f154f52..1404830 100755 (executable)
@@ -1992,6 +1992,10 @@ void ewkViewLoadCommitted(Evas_Object* ewkView)
     EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
     impl->gestureClient->reset();
 #endif
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+    if (impl->focusRing)
+        impl->focusRing->hide();
+#endif
 #if ENABLE(TIZEN_ISF_PORT)
     impl->inputMethodContext()->hideIMFContext();
 #endif
index cba19d7..fad2579 100755 (executable)
@@ -74,11 +74,26 @@ void FocusRing::setImage(const String& path, int outerWidth, int innerWidth)
     }
 }
 
-void FocusRing::requestToShow(const IntPoint& position)
+void FocusRing::requestToShow(const IntPoint& position, bool immediately)
 {
     if (!m_imagePath.isNull())
         return;
 
+    if (immediately) {
+        if (m_focusRingObject && evas_object_visible_get(m_focusRingObject))
+            return;
+        else {
+            if (m_showTimer) {
+                ecore_timer_del(m_showTimer);
+                m_showTimer = 0;
+            }
+
+            m_position = position;
+            show(IntRect());
+            return;
+        }
+    }
+
     m_position = position;
 
     if (m_showTimer)
index f15a6c2..802b3dc 100755 (executable)
@@ -40,7 +40,7 @@ public:
 
     void setImage(const String&, int, int);
 
-    void requestToShow(const WebCore::IntPoint&);
+    void requestToShow(const WebCore::IntPoint&, bool immediately = false);
     void requestToHide(bool immediately = false);
 
     void show(const WebCore::IntRect&, const bool includeOnlyImage = false);
index 4bf24b0..cf2c174 100755 (executable)
@@ -1259,11 +1259,21 @@ void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
     if (!isValid())
         return;
 
-#if ENABLE(TIZEN_ISF_PORT)
+#if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
     if (event.type() == WebEvent::GestureSingleTap) {
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+        FocusRing* focusRing = ewkViewGetFocusRing(viewWidget());
+        if (focusRing) {
+            IntPoint tapPosition = EwkViewImpl::fromEvasObject(viewWidget())->transformToScene().mapPoint(event.position());
+            focusRing->requestToShow(tapPosition, true);
+        }
+#endif
+
+#if ENABLE(TIZEN_ISF_PORT)
         InputMethodContextEfl* inputMethodContext = static_cast<PageClientImpl*>(m_pageClient)->viewImpl()->inputMethodContext();
         if (inputMethodContext)
             inputMethodContext->resetIMFContext();
+#endif
     }
 #endif