Source/WebKit: [EFL] Adds Accessibility support to wk1
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2013 08:02:36 +0000 (08:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2013 08:02:36 +0000 (08:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107440

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-01-22
Reviewed by Gyuyoung Kim.

* PlatformEfl.cmake: Adds ATK headers and libraries.

Source/WebKit/efl: [EFL] Adds Accessibility support to wk1.
https://bugs.webkit.org/show_bug.cgi?id=107440

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-01-22
Reviewed by Gyuyoung Kim.

Adds possibility of focusing and retrieving accessible object.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::rootAccessibleElement):
(DumpRenderTreeSupportEfl::focusedAccessibleElement):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:

Tools: [EFL] Adds Accessibility support to wk1
https://bugs.webkit.org/show_bug.cgi?id=107440

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-01-22
Reviewed by Gyuyoung Kim.

* DumpRenderTree/efl/CMakeLists.txt: Adds ATK headers and libraries.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140389 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/PlatformEfl.cmake
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
Tools/ChangeLog
Tools/DumpRenderTree/efl/CMakeLists.txt

index 1876351..9738fa3 100644 (file)
@@ -1,3 +1,12 @@
+2013-01-22  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Adds Accessibility support to wk1
+        https://bugs.webkit.org/show_bug.cgi?id=107440
+
+        Reviewed by Gyuyoung Kim.
+
+        * PlatformEfl.cmake: Adds ATK headers and libraries.
+
 2013-01-17  Poul Sysolyatin  <psytonx@gmail.com>
 
         32-bit build for Qt5 on Mac OS fails.
index 4db6d55..fc1c8e2 100644 (file)
@@ -89,6 +89,17 @@ if (ENABLE_GEOLOCATION)
     )
 endif ()
 
+if (ENABLE_ACCESSIBILITY)
+    list(APPEND WebKit_INCLUDE_DIRECTORIES
+        "${WEBCORE_DIR}/accessibility"
+        "${WEBCORE_DIR}/accessibility/atk"
+        ${ATK_INCLUDE_DIRS}
+    )
+    list(APPEND WebKit_LIBRARIES
+        ${ATK_LIBRARIES}
+    )
+endif ()
+
 list(APPEND WebKit_SOURCES
     efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp
     efl/WebCoreSupport/AssertMatchingEnums.cpp
index 8fbabce..13ceef1 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Adds Accessibility support to wk1.
+        https://bugs.webkit.org/show_bug.cgi?id=107440
+
+        Reviewed by Gyuyoung Kim.
+
+        Adds possibility of focusing and retrieving accessible object.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::rootAccessibleElement):
+        (DumpRenderTreeSupportEfl::focusedAccessibleElement):
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+
 2013-01-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Unreviewed. Fix build break by r139796.
index ef55bf1..a875bce 100644 (file)
 #include <wtf/CurrentTime.h>
 #endif
 
+#if HAVE(ACCESSIBILITY)
+#include "AXObjectCache.h"
+#include "AccessibilityObject.h"
+#include "WebKitAccessibleWrapperAtk.h"
+#endif
+
 #define DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, ...) \
     WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);  \
     if (!frame)                                               \
@@ -888,3 +894,31 @@ int DumpRenderTreeSupportEfl::numberOfPendingGeolocationPermissionRequests(const
     return 0;
 #endif
 }
+
+#if HAVE(ACCESSIBILITY)
+AtkObject* DumpRenderTreeSupportEfl::rootAccessibleElement(const Evas_Object* ewkFrame)
+{
+    DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, 0);
+
+    if (!WebCore::AXObjectCache::accessibilityEnabled())
+        WebCore::AXObjectCache::enableAccessibility();
+
+    if (!frame->document())
+        return 0;
+
+    AtkObject* wrapper = frame->document()->axObjectCache()->rootObject()->wrapper();
+    if (!wrapper)
+        return 0;
+
+    return wrapper;
+}
+
+AtkObject* DumpRenderTreeSupportEfl::focusedAccessibleElement(const Evas_Object* ewkFrame)
+{
+    AtkObject* wrapper = rootAccessibleElement(ewkFrame);
+    if (!wrapper)
+        return 0;
+
+    return webkitAccessibleGetFocusedElement(WEBKIT_ACCESSIBLE(wrapper));
+}
+#endif
index 7c700d5..7cbafac 100644 (file)
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
+#if HAVE(ACCESSIBILITY)
+#include <atk/atk.h>
+#endif
+
 typedef struct _Ewk_History_Item Ewk_History_Item;
 typedef struct _Ewk_Intent Ewk_Intent;
 typedef struct _Ewk_Intent_Request Ewk_Intent_Request;
@@ -139,6 +143,11 @@ public:
     static void setMockGeolocationPositionUnavailableError(const Evas_Object*, const char* errorMessage);
     static int numberOfPendingGeolocationPermissionRequests(const Evas_Object*);
 
+#if HAVE(ACCESSIBILITY)
+    static AtkObject* focusedAccessibleElement(const Evas_Object*);
+    static AtkObject* rootAccessibleElement(const Evas_Object*);
+#endif
+
 private:
     static bool s_drtRun;
 };
index a2533fc..4bba28b 100644 (file)
@@ -1,3 +1,12 @@
+2013-01-22  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Adds Accessibility support to wk1
+        https://bugs.webkit.org/show_bug.cgi?id=107440
+
+        Reviewed by Gyuyoung Kim.
+
+        * DumpRenderTree/efl/CMakeLists.txt: Adds ATK headers and libraries.
+
 2013-01-21  Joseph Pecoraro  <pecoraro@apple.com>
 
         [Mac] WK1 MiniBrowser should clear delegates before releasing webview
index 2b9c9a3..c068ea7 100644 (file)
@@ -111,6 +111,15 @@ set(DumpRenderTree_INCLUDE_DIRECTORIES
     ${LIBSOUP_INCLUDE_DIRS}
 )
 
+if (ENABLE_ACCESSIBILITY)
+    list(APPEND DumpRenderTree_INCLUDE_DIRECTORIES
+        ${ATK_INCLUDE_DIRS}
+    )
+    list(APPEND DumpRenderTree_LIBRARIES
+        ${ATK_LIBRARIES}
+    )
+endif ()
+
 # FIXME: DOWNLOADED_FONTS_DIR should not hardcode the directory
 # structure. See <https://bugs.webkit.org/show_bug.cgi?id=81475>.
 add_definitions(-DFONTS_CONF_DIR="${TOOLS_DIR}/DumpRenderTree/gtk/fonts"