[EFL][WK2] Expose accessibility hierarchy in WebKit2-EFL.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 10:11:51 +0000 (10:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 10:11:51 +0000 (10:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=106216

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-01-24
Reviewed by Andreas Kling.

Create WebPage's accessibility object on WebPage initialization.
Wrap around WebCore's accessibility objects.
Updating accessibility hierarchy. Expands accessibility implementation
of WebKit-GTK to be used in EFL.

* PlatformEfl.cmake:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
(webPageAccessibilityObjectGetIndexInParent):
(web_page_accessibility_object_init):
* WebProcess/WebPage/efl/WebPageEfl.cpp:
(WebKit::WebPage::platformInitialize):
(WebKit):
(WebKit::WebPage::updateAccessibilityTree):

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

Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index 230c468..97d23dc 100644 (file)
@@ -1,3 +1,28 @@
+2013-01-24  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL][WK2] Expose accessibility hierarchy in WebKit2-EFL.
+        https://bugs.webkit.org/show_bug.cgi?id=106216
+
+        Reviewed by Andreas Kling.
+
+        Create WebPage's accessibility object on WebPage initialization.
+        Wrap around WebCore's accessibility objects.
+        Updating accessibility hierarchy. Expands accessibility implementation
+        of WebKit-GTK to be used in EFL.
+
+        * PlatformEfl.cmake:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
+        * WebProcess/WebPage/WebPage.h:
+        (WebPage):
+        * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
+        (webPageAccessibilityObjectGetIndexInParent):
+        (web_page_accessibility_object_init):
+        * WebProcess/WebPage/efl/WebPageEfl.cpp:
+        (WebKit::WebPage::platformInitialize):
+        (WebKit):
+        (WebKit::WebPage::updateAccessibilityTree):
+
 2013-01-23  Seokju Kwon  <seokju.kwon@gmail.com>
 
         [EFL] Unreviewed build fix after r140605
index 35eb93c..33dae28 100644 (file)
@@ -136,6 +136,7 @@ list(APPEND WebKit2_SOURCES
 
     WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
 
+    WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
     WebProcess/WebPage/efl/WebInspectorEfl.cpp
     WebProcess/WebPage/efl/WebPageEfl.cpp
 
@@ -411,3 +412,13 @@ if (ENABLE_SPELLCHECK)
         ${ENCHANT_LIBRARIES}
     )
 endif ()
+
+if (ENABLE_ACCESSIBILITY)
+    list(APPEND WebKit2_INCLUDE_DIRECTORIES
+        "${WEBKIT2_DIR}/WebProcess/WebPage/atk"
+        ${ATK_INCLUDE_DIRS}
+    )
+    list(APPEND WebKit2_LIBRARIES
+        ${ATK_LIBRARIES}
+    )
+endif ()
index c2dd568..2302bf2 100644 (file)
@@ -1481,7 +1481,7 @@ void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*
 
     webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world);
 
-#if PLATFORM(GTK)
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
     // Ensure the accessibility hierarchy is updated.
     webPage->updateAccessibilityTree();
 #endif
index 7b5b93f..3bdb650 100644 (file)
 #include <QNetworkRequest>
 #endif
 
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
+#include "WebPageAccessibilityObject.h"
+#include <wtf/gobject/GRefPtr.h>
+#endif
+
 #if PLATFORM(GTK)
 #include "ArgumentCodersGtk.h"
-#include "WebPageAccessibilityObject.h"
 #include "WebPrintOperationGtk.h"
 #endif
 
@@ -460,12 +464,15 @@ public:
     void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
     void cancelComposition();
 #elif PLATFORM(GTK)
-    void updateAccessibilityTree();
 #if USE(TEXTURE_MAPPER_GL)
     void setAcceleratedCompositingWindowId(int64_t nativeWindowHandle);
 #endif
 #endif
 
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
+    void updateAccessibilityTree();
+#endif
+
     void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
     bool hasCompositionForTesting();
     void confirmCompositionForTesting(const String& compositionString);
@@ -849,7 +856,7 @@ private:
 
     WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
 
-#elif PLATFORM(GTK)
+#elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
     GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
 
 #if USE(TEXTURE_MAPPER_GL)
index 70a6d15..58e33a3 100644 (file)
@@ -75,7 +75,7 @@ static void webPageAccessibilityObjectInitialize(AtkObject* atkObject, gpointer
     atk_object_set_role(atkObject, ATK_ROLE_FILLER);
 }
 
-static gint webPageAccessibilityObjectGetIndexInParent(AtkObject *atkObject)
+static gint webPageAccessibilityObjectGetIndexInParent(AtkObject*)
 {
     // An AtkPlug is the only child an AtkSocket can have.
     return 0;
@@ -106,7 +106,7 @@ static AtkObject* webPageAccessibilityObjectRefChild(AtkObject* atkObject, gint
     return rootObject;
 }
 
-static void web_page_accessibility_object_init(WebPageAccessibilityObject* accessible)
+static void web_page_accessibility_object_init(WebPageAccessibilityObject*)
 {
 }
 
index 520ce85..2fb0c32 100644 (file)
 #include <WebCore/RenderThemeEfl.h>
 #include <WebCore/Settings.h>
 
+#if HAVE(ACCESSIBILITY)
+#include "WebPageAccessibilityObject.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
 
 void WebPage::platformInitialize()
 {
+#if HAVE(ACCESSIBILITY)
+    m_accessibilityObject = adoptGRef(webPageAccessibilityObjectNew(this));
+#else
     notImplemented();
+#endif
+}
+
+#if HAVE(ACCESSIBILITY)
+void WebPage::updateAccessibilityTree()
+{
+    if (!m_accessibilityObject)
+        return;
+
+    webPageAccessibilityObjectRefresh(m_accessibilityObject.get());
 }
+#endif
 
 void WebPage::platformPreferencesDidChange(const WebPreferencesStore&)
 {