[GTK] Expose accessibility hierarchy in WebKit2 to ATK/AT-SPI based ATs
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 11:29:36 +0000 (11:29 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 11:29:36 +0000 (11:29 +0000)
commit6bb5c06e8040ee326f01de9801aae26969042d57
tree40f968d2a51907c26c2dfe159f47cd02fe23e075
parent19dd04a884e8a2e42e35bc35b460996d8d8bb15d
[GTK] Expose accessibility hierarchy in WebKit2 to ATK/AT-SPI based ATs
https://bugs.webkit.org/show_bug.cgi?id=72589

Reviewed by Martin Robinson.

.:

New optional dependency for WK2's accessibility unit test: AT-SPI2.

* configure.ac: Check for AT-SPI2 when building with WK2 support.

Source/WebKit2:

Expose the accessibility hierarchy in the multi-process
architecture of WK2 through AtkSocket and AtkPlug.

Make the WebView widget return an AtkSocket when calling to
gtk_widget_get_accessible().

* GNUmakefile.am: Add new files.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkit_web_view_base_init):
(webkitWebViewBaseGetAccessible):
(webkit_web_view_base_class_init):
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: Added.
(webkitWebViewBaseAccessibleWidgetFinalize):
(webkitWebViewBaseAccessibleWidgetDestroyed):
(webkitWebViewBaseAccessibleInitialize):
(webkitWebViewBaseAccessibleRefStateSet):
(webkitWebViewBaseAccessibleGetIndexInParent):
(webkit_web_view_base_accessible_init):
(webkit_web_view_base_accessible_class_init):
(webkitWebViewBaseAccessibleNew):
* UIProcess/API/gtk/WebKitWebViewBaseAccessible.h: Added.

Make the WebPage create an AtkPlug on its initialization and
sending the ID of that plug to the UI process, so it can embed the
plug in the socket.

Also, take care of all the needed wrapping around the WebCore's
accessibility objects, exposing them in the UI process's
accessibility hierarchy thanks to the socket-plug connection.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::accessibilityPlugID):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::bindAccessibilityTree):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/gtk/WebPageAccessibilityObject.cpp: Added.
(accessibilityRootObjectWrapper):
(webPageAccessibilityObjectInitialize):
(webPageAccessibilityObjectGetIndexInParent):
(webPageAccessibilityObjectGetNChildren):
(webPageAccessibilityObjectRefChild):
(web_page_accessibility_object_init):
(web_page_accessibility_object_class_init):
(webPageAccessibilityObjectNew):
(webPageAccessibilityObjectRefresh):
* WebProcess/WebPage/gtk/WebPageAccessibilityObject.h: Added.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):
(WebKit::WebPage::updateAccessibilityTree):

New unit test for checking accessibility support in WK2GTK.

* UIProcess/API/gtk/tests/AccessibilityTestServer.cpp: Added.
(loadChangedCallback): Notify the parent process (the test)
when ready.
(main):
* UIProcess/API/gtk/tests/GNUmakefile.am:
* UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp: Added.
(stopTestServer):
(sigAbortHandler):
(testServerMonitorThreadFunc):
(startTestServerMonitor):
(startTestServer):
(checkAtspiAccessible):
(findTestServerApplication):
(testAtspiBasicHierarchy):
(beforeAll):
(afterAll):

Tools:

Ensure the accessibility infrastructure is available when running
the unit tests, otherwise WK2's accessibility tests won't work.

* Scripts/run-gtk-tests:
(TestRunner):
(TestRunner._lookup_atspi2_binary): New. Looks for the directory
where at-spi2's stuff is located (like at-spi-bus-launcher and
at-spi2-registryd).
(TestRunner.run): Initialize the accessibility infrastructure.

* gtk/generate-gtkdoc:
(get_webkit2_options): Add 'WebKitWebViewBaseAccessible.*'.

* gtk/jhbuild.modules: Added at-spi2-core and at-spi2-atk.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/tests/AccessibilityTestServer.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.h [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
Tools/ChangeLog
Tools/Scripts/run-gtk-tests
Tools/gtk/generate-gtkdoc
Tools/gtk/jhbuild.modules
configure.ac