Title: [175098] trunk/Source/WebKit2
Revision
175098
Author
[email protected]
Date
2014-10-23 01:02:35 -0700 (Thu, 23 Oct 2014)

Log Message

[EFL] Introduce EFL Accessibility in WebKit
https://bugs.webkit.org/show_bug.cgi?id=137819

Reviewed by Gyuyoung Kim.

EFL Accessibility provides an API that is used to notify clients that certain
Accessibility events occur. Utilizing it makes WebKit-EFL coherent with EFL native
accessibility approach.

* PlatformEfl.cmake:
* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
* UIProcess/API/efl/EwkView.h:
(EwkView::webAccessibility):
* UIProcess/API/efl/WebAccessibility.cpp: Added.
(WebKit::WebAccessibility::WebAccessibility):
(WebKit::WebAccessibility::~WebAccessibility):
(WebKit::WebAccessibility::eventHandler):
(WebKit::WebAccessibility::executeGestureAction):
(WebKit::WebAccessibility::activate):
(WebKit::WebAccessibility::read):
(WebKit::WebAccessibility::readNext):
(WebKit::WebAccessibility::readPrev):
(WebKit::WebAccessibility::up):
(WebKit::WebAccessibility::down):
(WebKit::WebAccessibility::scroll):
(WebKit::WebAccessibility::mouse):
(WebKit::WebAccessibility::enable):
(WebKit::WebAccessibility::disable):
* UIProcess/API/efl/WebAccessibility.h: Added.
(WebKit::WebAccessibility::activateAction):
(WebKit::WebAccessibility::nextAction):
(WebKit::WebAccessibility::prevAction):
(WebKit::WebAccessibility::readAction):
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_accessibility_action_activate_get):
(ewk_view_accessibility_action_next_get):
(ewk_view_accessibility_action_prev_get):
(ewk_view_accessibility_action_read_by_point_get):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Added.
(EWK2Accessibility::xwindow):
(TEST_F):
* UIProcess/WebPageProxy.h:
* UIProcess/efl/WebPageProxyEfl.cpp:
(WebKit::WebPageProxy::accessibilityObjectReadByPoint):
(WebKit::WebPageProxy::accessibilityObjectReadPrevious):
(WebKit::WebPageProxy::accessibilityObjectReadNext):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (175097 => 175098)


--- trunk/Source/WebKit2/ChangeLog	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/ChangeLog	2014-10-23 08:02:35 UTC (rev 175098)
@@ -1,3 +1,54 @@
+2014-10-23  Krzysztof Czech  <[email protected]>
+
+        [EFL] Introduce EFL Accessibility in WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=137819
+
+        Reviewed by Gyuyoung Kim.
+
+        EFL Accessibility provides an API that is used to notify clients that certain
+        Accessibility events occur. Utilizing it makes WebKit-EFL coherent with EFL native
+        accessibility approach.
+
+        * PlatformEfl.cmake:
+        * UIProcess/API/efl/EwkView.cpp:
+        (EwkView::EwkView):
+        * UIProcess/API/efl/EwkView.h:
+        (EwkView::webAccessibility):
+        * UIProcess/API/efl/WebAccessibility.cpp: Added.
+        (WebKit::WebAccessibility::WebAccessibility):
+        (WebKit::WebAccessibility::~WebAccessibility):
+        (WebKit::WebAccessibility::eventHandler):
+        (WebKit::WebAccessibility::executeGestureAction):
+        (WebKit::WebAccessibility::activate):
+        (WebKit::WebAccessibility::read):
+        (WebKit::WebAccessibility::readNext):
+        (WebKit::WebAccessibility::readPrev):
+        (WebKit::WebAccessibility::up):
+        (WebKit::WebAccessibility::down):
+        (WebKit::WebAccessibility::scroll):
+        (WebKit::WebAccessibility::mouse):
+        (WebKit::WebAccessibility::enable):
+        (WebKit::WebAccessibility::disable):
+        * UIProcess/API/efl/WebAccessibility.h: Added.
+        (WebKit::WebAccessibility::activateAction):
+        (WebKit::WebAccessibility::nextAction):
+        (WebKit::WebAccessibility::prevAction):
+        (WebKit::WebAccessibility::readAction):
+        * UIProcess/API/efl/ewk_view.cpp:
+        (ewk_view_accessibility_action_activate_get):
+        (ewk_view_accessibility_action_next_get):
+        (ewk_view_accessibility_action_prev_get):
+        (ewk_view_accessibility_action_read_by_point_get):
+        * UIProcess/API/efl/ewk_view.h:
+        * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Added.
+        (EWK2Accessibility::xwindow):
+        (TEST_F):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/efl/WebPageProxyEfl.cpp:
+        (WebKit::WebPageProxy::accessibilityObjectReadByPoint):
+        (WebKit::WebPageProxy::accessibilityObjectReadPrevious):
+        (WebKit::WebPageProxy::accessibilityObjectReadNext):
+
 2014-10-22  Benjamin Poulain  <[email protected]>
 
         [iOS WK2] Protect WKWebView dynamic viewport change against empty sizes

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (175097 => 175098)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2014-10-23 08:02:35 UTC (rev 175098)
@@ -80,6 +80,7 @@
     UIProcess/API/efl/EwkView.cpp
     UIProcess/API/efl/GestureRecognizer.cpp
     UIProcess/API/efl/SnapshotImageGL.cpp
+    UIProcess/API/efl/WebAccessibility.cpp
     UIProcess/API/efl/ewk_application_cache_manager.cpp
     UIProcess/API/efl/ewk_auth_request.cpp
     UIProcess/API/efl/ewk_back_forward_list.cpp
@@ -492,6 +493,7 @@
 # The "ewk" on the test name needs to be suffixed with "2", otherwise it
 # will clash with tests from the WebKit 1 test suite.
 set(EWK2UnitTests_BINARIES
+    test_ewk2_accessibility
     test_ewk2_application_cache_manager
     test_ewk2_auth_request
     test_ewk2_back_forward_list

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp (175097 => 175098)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2014-10-23 08:02:35 UTC (rev 175098)
@@ -82,6 +82,10 @@
 #include "WebFullScreenManagerProxy.h"
 #endif
 
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+#include "WebAccessibility.h"
+#endif
+
 using namespace EwkViewCallbacks;
 using namespace WebCore;
 using namespace WebKit;
@@ -297,6 +301,9 @@
 #endif
     , m_displayTimer(this, &EwkView::displayTimerFired)
     , m_inputMethodContext(InputMethodContextEfl::create(this, smartData()->base.evas))
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    , m_webAccessibility(std::make_unique<WebAccessibility>(this))
+#endif
     , m_pageViewportControllerClient(this)
     , m_pageViewportController(page(), &m_pageViewportControllerClient)
     , m_isAccelerated(true)

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h (175097 => 175098)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h	2014-10-23 08:02:35 UTC (rev 175098)
@@ -59,6 +59,10 @@
 #if ENABLE(VIBRATION)
 class VibrationClientEfl;
 #endif
+
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+class WebAccessibility;
+#endif
 }
 
 namespace WebCore {
@@ -201,6 +205,10 @@
 
     static const char smartClassName[];
 
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    WebKit::WebAccessibility* webAccessibility() { return m_webAccessibility.get(); }
+#endif
+
 private:
     EwkView(WKViewRef, Evas_Object*);
     ~EwkView();
@@ -301,6 +309,10 @@
     std::unique_ptr<EwkColorPicker> m_colorPicker;
 #endif
 
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    std::unique_ptr<WebKit::WebAccessibility> m_webAccessibility;
+#endif
+
     WebKit::PageViewportControllerClientEfl m_pageViewportControllerClient;
     WebKit::PageViewportController m_pageViewportController;
 

Added: trunk/Source/WebKit2/UIProcess/API/efl/WebAccessibility.cpp (0 => 175098)


--- trunk/Source/WebKit2/UIProcess/API/efl/WebAccessibility.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/WebAccessibility.cpp	2014-10-23 08:02:35 UTC (rev 175098)
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebAccessibility.h"
+
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+
+#include "EwkView.h"
+#include "WKViewEfl.h"
+#include "WebHitTestResult.h"
+#include <WebCore/NotImplemented.h>
+
+namespace WebKit {
+
+WebAccessibility::WebAccessibility(EwkView* ewkView)
+    : m_activateAction(false)
+    , m_nextAction(false)
+    , m_prevAction(false)
+    , m_readAction(false)
+    , m_currentPoint(WebCore::IntPoint(-1, -1))
+    , m_ewkView(ewkView)
+    , m_eventHandler(ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, eventHandler, this))
+{
+}
+
+WebAccessibility::~WebAccessibility()
+{
+    ecore_event_handler_del(m_eventHandler);
+}
+
+Eina_Bool WebAccessibility::eventHandler(void* data, int, void* event)
+{
+    WebAccessibility* webAccessibility = static_cast<WebAccessibility*>(data);
+    if (!webAccessibility)
+        return false;
+
+    Ecore_X_Event_Client_Message* ev = static_cast<Ecore_X_Event_Client_Message*>(event);
+    if (!ev)
+        return false;
+
+    return webAccessibility->action(ev);
+}
+
+Eina_Bool WebAccessibility::action(Ecore_X_Event_Client_Message* event)
+{
+    if (event->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL) {
+        unsigned gestureType = static_cast<unsigned>(event->data.l[1]);
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
+            return activate();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
+            return read(event->data.l[2], event->data.l[3]);
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_OVER)
+            return read(event->data.l[2], event->data.l[3]);
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
+            return readNext();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
+            return readPrev();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
+            return up();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
+            return down();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_SCROLL)
+            return scroll();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_MOUSE)
+            return mouse();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ENABLE)
+            return enable();
+
+        if (gestureType == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DISABLE)
+            return disable();
+    }
+
+    return true;
+}
+
+bool WebAccessibility::activate()
+{
+    notImplemented();
+    return false;
+}
+
+bool WebAccessibility::read(int, int)
+{
+    ASSERT(m_ewkView);
+    m_readAction = m_ewkView->page()->accessibilityObjectReadByPoint(WebCore::IntPoint(m_currentPoint.x(), m_currentPoint.y()));
+    return m_readAction;
+}
+
+bool WebAccessibility::readNext()
+{
+    ASSERT(m_ewkView);
+    m_nextAction = m_ewkView->page()->accessibilityObjectReadPrevious();
+    return m_nextAction;
+}
+
+bool WebAccessibility::readPrev()
+{
+    ASSERT(m_ewkView);
+    m_prevAction = m_ewkView->page()->accessibilityObjectReadPrevious();
+    return m_prevAction;
+}
+
+bool WebAccessibility::up()
+{
+    notImplemented();
+    return false;
+}
+
+bool WebAccessibility::down()
+{
+    notImplemented();
+    return false;
+}
+
+bool WebAccessibility::scroll()
+{
+    notImplemented();
+    return false;
+}
+
+bool WebAccessibility::mouse()
+{
+    notImplemented();
+    return false;
+}
+
+bool WebAccessibility::enable()
+{
+    notImplemented();
+    return false;
+}
+
+bool WebAccessibility::disable()
+{
+    notImplemented();
+    return false;
+}
+
+} // namespace WebKit
+
+#endif // HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)

Added: trunk/Source/WebKit2/UIProcess/API/efl/WebAccessibility.h (0 => 175098)


--- trunk/Source/WebKit2/UIProcess/API/efl/WebAccessibility.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/WebAccessibility.h	2014-10-23 08:02:35 UTC (rev 175098)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebAccessibility_h
+#define WebAccessibility_h
+
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+
+#include <Ecore.h>
+#include <Ecore_X.h>
+#include <Eina.h>
+#include <WebCore/IntPoint.h>
+
+class EwkView;
+
+namespace WebKit {
+
+class WebAccessibility {
+public:
+    explicit WebAccessibility(EwkView* ewkView);
+    ~WebAccessibility();
+
+    bool activateAction() const { return m_activateAction; }
+    bool nextAction() const { return m_nextAction; }
+    bool prevAction() const { return m_prevAction; }
+    bool readAction() const { return m_readAction; }
+
+private:
+    static Eina_Bool eventHandler(void*, int, void*);
+
+    Eina_Bool action(Ecore_X_Event_Client_Message*);
+
+    // Actions
+    bool activate();
+    bool read(int, int);
+    bool readNext();
+    bool readPrev();
+    bool up();
+    bool down();
+    bool scroll();
+    bool zoom();
+    bool mouse();
+    bool enable();
+    bool disable();
+
+    bool m_activateAction;
+    bool m_nextAction;
+    bool m_prevAction;
+    bool m_readAction;
+
+    WebCore::IntPoint m_currentPoint;
+    EwkView* m_ewkView;
+    Ecore_Event_Handler* m_eventHandler;
+};
+
+} // namespace WebKit
+
+#endif // HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+
+#endif // WebAccessibility_h

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (175097 => 175098)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2014-10-23 08:02:35 UTC (rev 175098)
@@ -46,6 +46,10 @@
 #include "WebInspectorProxy.h"
 #endif
 
+#if HAVE(ACCESSIBILITY)
+#include "WebAccessibility.h"
+#endif
+
 using namespace WebKit;
 
 static inline EwkView* toEwkViewChecked(const Evas_Object* evasObject)
@@ -784,3 +788,47 @@
 
     return true;
 }
+
+Eina_Bool ewk_view_accessibility_action_activate_get(const Evas_Object* ewkView)
+{
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
+    return impl->webAccessibility()->activateAction();
+#else
+    UNUSED_PARAM(ewkView);
+    return false;
+#endif
+}
+
+Eina_Bool ewk_view_accessibility_action_next_get(const Evas_Object* ewkView)
+{
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
+    return impl->webAccessibility()->nextAction();
+#else
+    UNUSED_PARAM(ewkView);
+    return false;
+#endif
+}
+
+Eina_Bool ewk_view_accessibility_action_prev_get(const Evas_Object* ewkView)
+{
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
+    return impl->webAccessibility()->prevAction();
+#else
+    UNUSED_PARAM(ewkView);
+    return false;
+#endif
+}
+
+Eina_Bool ewk_view_accessibility_action_read_by_point_get(const Evas_Object* ewkView)
+{
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
+    return impl->webAccessibility()->readAction();
+#else
+    UNUSED_PARAM(ewkView);
+    return false;
+#endif
+}

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h (175097 => 175098)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h	2014-10-23 08:02:35 UTC (rev 175098)
@@ -1018,6 +1018,42 @@
  */
 EAPI Eina_Bool ewk_view_contents_size_get(const Evas_Object *o, Evas_Coord *width, Evas_Coord *height);
 
+/**
+ * Get status of the activate action. Activate action describes the click.
+ *
+ * @param o view of the object
+ *
+ * @return @c EINA_TRUE on success, or @c EINA_FALSE otherwise
+ */
+EAPI Eina_Bool ewk_view_accessibility_action_activate_get(const Evas_Object *o);
+
+/**
+ * Get status of the next action. Action next moves and focuses next object.
+ *
+ * @param o view of the object
+ *
+ * @return @c EINA_TRUE on success, or @c EINA_FALSE otherwise
+ */
+EAPI Eina_Bool ewk_view_accessibility_action_next_get(const Evas_Object *o);
+
+/**
+ * Get status of the previous action. Previous action moves and focuses previous element.
+ *
+ * @param o view of the object
+ *
+ * @return @c EINA_TRUE on success, or @c EINA_FALSE otherwise
+ */
+EAPI Eina_Bool ewk_view_accessibility_action_prev_get(const Evas_Object *o);
+
+/**
+ * Get status of the read action. Read action focuses object with specific coordinates.
+ *
+ * @param o view of the object
+ *
+ * @return @c EINA_TRUE on success, or @c EINA_FALSE otherwise
+ */
+EAPI Eina_Bool ewk_view_accessibility_action_read_by_point_get(const Evas_Object *o);
+
 #ifdef __cplusplus
 }
 #endif

Added: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_accessibility.cpp (0 => 175098)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_accessibility.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_accessibility.cpp	2014-10-23 08:02:35 UTC (rev 175098)
@@ -0,0 +1,52 @@
+#include "config.h"
+
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+
+#include "UnitTestUtils/EWK2UnitTestBase.h"
+#include <Ecore_Evas.h>
+#include <Ecore_X.h>
+#include <WebCore/EflScreenUtilities.h>
+
+using namespace EWK2UnitTest;
+
+class EWK2Accessibility : public EWK2UnitTestBase {
+protected:
+    Ecore_X_Window xwindow()
+    {
+        return WebCore::getEcoreXWindow(ecore_evas_ecore_evas_get(evas_object_evas_get(webView())));
+    }
+};
+
+TEST_F(EWK2Accessibility, ewk_accessibility_action_activate)
+{
+    ecore_x_e_illume_access_action_activate_send(xwindow());
+    bool activateSend = false;
+    waitUntilTrue(activateSend, 1);
+    ASSERT_TRUE(ewk_view_accessibility_action_activate_get(webView()));
+}
+
+TEST_F(EWK2Accessibility, ewk_accessibility_action_next)
+{
+    ecore_x_e_illume_access_action_read_next_send(xwindow());
+    bool nextSend = false;
+    waitUntilTrue(nextSend, 1);
+    ASSERT_TRUE(ewk_view_accessibility_action_next_get(webView()));
+}
+
+TEST_F(EWK2Accessibility, ewk_accessibility_action_prev)
+{
+    ecore_x_e_illume_access_action_read_prev_send(xwindow());
+    bool prevSend = false;
+    waitUntilTrue(prevSend, 1);
+    ASSERT_TRUE(ewk_view_accessibility_action_prev_get(webView()));
+}
+
+TEST_F(EWK2Accessibility, ewk_accessibility_action_read_by_point)
+{
+    ecore_x_e_illume_access_action_read_send(xwindow());
+    bool readSend = false;
+    waitUntilTrue(readSend, 1);
+    ASSERT_TRUE(ewk_view_accessibility_action_read_by_point_get(webView()));
+}
+
+#endif // HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (175097 => 175098)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-10-23 08:02:35 UTC (rev 175098)
@@ -926,6 +926,12 @@
     void performActionMenuHitTestAtLocation(WebCore::FloatPoint);
 #endif
 
+#if PLATFORM(EFL) && HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+    bool accessibilityObjectReadByPoint(const WebCore::IntPoint&);
+    bool accessibilityObjectReadPrevious();
+    bool accessibilityObjectReadNext();
+#endif
+
 private:
     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
     void platformInitialize();

Modified: trunk/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp (175097 => 175098)


--- trunk/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp	2014-10-23 07:27:38 UTC (rev 175097)
+++ trunk/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp	2014-10-23 08:02:35 UTC (rev 175098)
@@ -140,4 +140,27 @@
     m_uiPopupMenuClient.initialize(client);
 }
 
+#if HAVE(ACCESSIBILITY) && defined(HAVE_ECORE_X)
+
+bool WebPageProxy::accessibilityObjectReadByPoint(const WebCore::IntPoint& point)
+{
+    UNUSED_PARAM(point);
+    notImplemented();
+    return false;
+}
+
+bool WebPageProxy::accessibilityObjectReadPrevious()
+{
+    notImplemented();
+    return false;
+}
+
+bool WebPageProxy::accessibilityObjectReadNext()
+{
+    notImplemented();
+    return false;
+}
+
+#endif
+
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to