Changeset 105503 in webkit
- Timestamp:
- Jan 20, 2012 3:29:36 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r105498 r105503 1 2012-01-20 Mario Sanchez Prada <msanchez@igalia.com> 2 3 [GTK] Expose accessibility hierarchy in WebKit2 to ATK/AT-SPI based ATs 4 https://bugs.webkit.org/show_bug.cgi?id=72589 5 6 Reviewed by Martin Robinson. 7 8 New optional dependency for WK2's accessibility unit test: AT-SPI2. 9 10 * configure.ac: Check for AT-SPI2 when building with WK2 support. 11 1 12 2012-01-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2 13 -
trunk/Source/WebKit2/ChangeLog
r105498 r105503 1 2012-01-20 Mario Sanchez Prada <msanchez@igalia.com> 2 3 [GTK] Expose accessibility hierarchy in WebKit2 to ATK/AT-SPI based ATs 4 https://bugs.webkit.org/show_bug.cgi?id=72589 5 6 Reviewed by Martin Robinson. 7 8 Expose the accessibility hierarchy in the multi-process 9 architecture of WK2 through AtkSocket and AtkPlug. 10 11 Make the WebView widget return an AtkSocket when calling to 12 gtk_widget_get_accessible(). 13 14 * GNUmakefile.am: Add new files. 15 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 16 (webkit_web_view_base_init): 17 (webkitWebViewBaseGetAccessible): 18 (webkit_web_view_base_class_init): 19 * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: Added. 20 (webkitWebViewBaseAccessibleWidgetFinalize): 21 (webkitWebViewBaseAccessibleWidgetDestroyed): 22 (webkitWebViewBaseAccessibleInitialize): 23 (webkitWebViewBaseAccessibleRefStateSet): 24 (webkitWebViewBaseAccessibleGetIndexInParent): 25 (webkit_web_view_base_accessible_init): 26 (webkit_web_view_base_accessible_class_init): 27 (webkitWebViewBaseAccessibleNew): 28 * UIProcess/API/gtk/WebKitWebViewBaseAccessible.h: Added. 29 30 Make the WebPage create an AtkPlug on its initialization and 31 sending the ID of that plug to the UI process, so it can embed the 32 plug in the socket. 33 34 Also, take care of all the needed wrapping around the WebCore's 35 accessibility objects, exposing them in the UI process's 36 accessibility hierarchy thanks to the socket-plug connection. 37 38 * UIProcess/WebPageProxy.h: 39 (WebKit::WebPageProxy::accessibilityPlugID): 40 * UIProcess/WebPageProxy.messages.in: 41 * UIProcess/gtk/WebPageProxyGtk.cpp: 42 (WebKit::WebPageProxy::bindAccessibilityTree): 43 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 44 (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad): 45 * WebProcess/WebPage/WebPage.cpp: 46 (WebKit::WebPage::WebPage): 47 * WebProcess/WebPage/gtk/WebPageAccessibilityObject.cpp: Added. 48 (accessibilityRootObjectWrapper): 49 (webPageAccessibilityObjectInitialize): 50 (webPageAccessibilityObjectGetIndexInParent): 51 (webPageAccessibilityObjectGetNChildren): 52 (webPageAccessibilityObjectRefChild): 53 (web_page_accessibility_object_init): 54 (web_page_accessibility_object_class_init): 55 (webPageAccessibilityObjectNew): 56 (webPageAccessibilityObjectRefresh): 57 * WebProcess/WebPage/gtk/WebPageAccessibilityObject.h: Added. 58 * WebProcess/WebPage/gtk/WebPageGtk.cpp: 59 (WebKit::WebPage::platformInitialize): 60 (WebKit::WebPage::updateAccessibilityTree): 61 62 New unit test for checking accessibility support in WK2GTK. 63 64 * UIProcess/API/gtk/tests/AccessibilityTestServer.cpp: Added. 65 (loadChangedCallback): Notify the parent process (the test) 66 when ready. 67 (main): 68 * UIProcess/API/gtk/tests/GNUmakefile.am: 69 * UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp: Added. 70 (stopTestServer): 71 (sigAbortHandler): 72 (testServerMonitorThreadFunc): 73 (startTestServerMonitor): 74 (startTestServer): 75 (checkAtspiAccessible): 76 (findTestServerApplication): 77 (testAtspiBasicHierarchy): 78 (beforeAll): 79 (afterAll): 80 1 81 2012-01-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2 82 -
trunk/Source/WebKit2/GNUmakefile.am
r105475 r105503 547 547 Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.h \ 548 548 Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp \ 549 Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.h \ 550 Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp \ 549 551 Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h \ 550 552 Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp \ … … 892 894 Source/WebKit2/WebProcess/WebPage/FindController.h \ 893 895 Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorGtk.cpp \ 896 Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.h \ 897 Source/WebKit2/WebProcess/WebPage/gtk/WebPageAccessibilityObject.cpp \ 894 898 Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp \ 895 899 Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp \ -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r105289 r105503 37 37 #include "WebEventFactory.h" 38 38 #include "WebKitPrivate.h" 39 #include "WebKitWebViewBaseAccessible.h" 39 40 #include "WebKitWebViewBasePrivate.h" 40 41 #include "WebPageProxy.h" … … 70 71 DragIcon dragIcon; 71 72 IntSize resizerSize; 73 GRefPtr<AtkObject> accessible; 72 74 }; 73 75 … … 376 378 } 377 379 380 static AtkObject* webkitWebViewBaseGetAccessible(GtkWidget* widget) 381 { 382 // If the socket has already been created and embedded a plug ID, return it. 383 WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)->priv; 384 if (priv->accessible && atk_socket_is_occupied(ATK_SOCKET(priv->accessible.get()))) 385 return priv->accessible.get(); 386 387 // Create the accessible object and associate it to the widget. 388 if (!priv->accessible) { 389 priv->accessible = adoptGRef(ATK_OBJECT(webkitWebViewBaseAccessibleNew(widget))); 390 391 // Set the parent not to break bottom-up navigation. 392 GtkWidget* parentWidget = gtk_widget_get_parent(widget); 393 AtkObject* axParent = parentWidget ? gtk_widget_get_accessible(parentWidget) : 0; 394 if (axParent) 395 atk_object_set_parent(priv->accessible.get(), axParent); 396 } 397 398 // Try to embed the plug in the socket, if posssible. 399 String plugID = priv->pageProxy->accessibilityPlugID(); 400 if (plugID.isNull()) 401 return priv->accessible.get(); 402 403 atk_socket_embed(ATK_SOCKET(priv->accessible.get()), const_cast<gchar*>(plugID.utf8().data())); 404 405 return priv->accessible.get(); 406 } 407 378 408 static gboolean webkitWebViewBaseDragMotion(GtkWidget* widget, GdkDragContext* context, gint x, gint y, guint time) 379 409 { … … 440 470 widgetClass->drag_drop = webkitWebViewBaseDragDrop; 441 471 widgetClass->drag_data_received = webkitWebViewBaseDragDataReceived; 472 widgetClass->get_accessible = webkitWebViewBaseGetAccessible; 442 473 443 474 GObjectClass* gobjectClass = G_OBJECT_CLASS(webkitWebViewBaseClass); -
trunk/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
r98245 r105503 7 7 8 8 noinst_PROGRAMS += $(TEST_PROGS) 9 10 if HAVE_ATSPI2 11 TEST_PROGS += Programs/WebKit2APITests/TestWebKitAccessibility 12 13 noinst_PROGRAMS += Programs/WebKit2APITests/AccessibilityTestServer 14 endif 15 9 16 webkit2_tests_cppflags = \ 10 17 -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs\" \ … … 77 84 Programs_WebKit2APITests_TestBackForwardList_LDFLAGS = $(webkit2_tests_ldflags) 78 85 86 if HAVE_ATSPI2 87 Programs_WebKit2APITests_AccessibilityTestServer_SOURCES = \ 88 Source/WebKit2/UIProcess/API/gtk/tests/AccessibilityTestServer.cpp 89 Programs_WebKit2APITests_AccessibilityTestServer_CPPFLAGS = $(webkit2_tests_cppflags) 90 Programs_WebKit2APITests_AccessibilityTestServer_LDADD = $(webkit2_tests_ldadd) 91 Programs_WebKit2APITests_AccessibilityTestServer_LDFLAGS = $(webkit2_tests_ldflags) 92 93 Programs_WebKit2APITests_TestWebKitAccessibility_SOURCES = \ 94 Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp 95 Programs_WebKit2APITests_TestWebKitAccessibility_CPPFLAGS = $(webkit2_tests_cppflags) $(ATSPI2_CFLAGS) 96 Programs_WebKit2APITests_TestWebKitAccessibility_LDADD = $(webkit2_tests_ldadd) $(ATSPI2_LIBS) 97 Programs_WebKit2APITests_TestWebKitAccessibility_LDFLAGS = $(webkit2_tests_ldflags) 98 endif -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r105439 r105503 570 570 bool isSmartInsertDeleteEnabled() const { return m_isSmartInsertDeleteEnabled; } 571 571 void setSmartInsertDeleteEnabled(bool); 572 #endif 573 574 #if PLATFORM(GTK) 575 String accessibilityPlugID() const { return m_accessibilityPlugID; } 572 576 #endif 573 577 … … 751 755 #if PLATFORM(GTK) 752 756 void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&); 757 void bindAccessibilityTree(const String&); 753 758 #endif 754 759 #if PLATFORM(EFL) … … 980 985 #endif 981 986 987 #if PLATFORM(GTK) 988 String m_accessibilityPlugID; 989 #endif 990 982 991 int64_t m_spellDocumentTag; 983 992 bool m_hasSpellDocumentTag; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r105275 r105503 148 148 # Support for GTK+ platform keybindings 149 149 GetEditorCommandsForKeyEvent(AtomicString eventType) -> (Vector<WTF::String> commandsList) 150 151 # Support for connecting the Accessibility worlds of the UI and the Web processes 152 BindAccessibilityTree(WTF::String plugID) 150 153 #endif 151 154 -
trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
r95901 r105503 50 50 } 51 51 52 void WebPageProxy::bindAccessibilityTree(const String& plugID) 53 { 54 m_accessibilityPlugID = plugID; 55 } 56 52 57 void WebPageProxy::saveRecentSearches(const String&, const Vector<String>&) 53 58 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r105062 r105503 1373 1373 1374 1374 webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world); 1375 1376 #if PLATFORM(GTK) 1377 // Ensure the accessibility hierarchy is updated. 1378 webPage->updateAccessibilityTree(); 1379 #endif 1375 1380 } 1376 1381 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r105497 r105503 190 190 #elif PLATFORM(WIN) 191 191 , m_nativeWindow(parameters.nativeWindow) 192 #elif PLATFORM(GTK) 193 , m_accessibilityObject(0) 192 194 #endif 193 195 , m_setCanStartMediaTimer(WebProcess::shared().runLoop(), this, &WebPage::setCanStartMediaTimerFired) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r105475 r105503 71 71 #if PLATFORM(GTK) 72 72 #include "ArgumentCodersGtk.h" 73 #include "WebPageAccessibilityObject.h" 73 74 #endif 74 75 … … 398 399 void gestureDidScroll(const WebCore::IntSize&); 399 400 void gestureDidEnd(); 401 402 #elif PLATFORM(GTK) 403 void updateAccessibilityTree(); 400 404 #endif 401 405 … … 599 603 void setTextForActivePopupMenu(int32_t index); 600 604 601 #if PLATFORM(GTK) 605 #if PLATFORM(GTK) 602 606 void failedToShowPopupMenu(); 603 #endif 607 #endif 604 608 605 609 void didChooseFilesForOpenPanel(const Vector<String>&); … … 678 682 679 683 RefPtr<WebCore::Node> m_gestureTargetNode; 684 #elif PLATFORM(GTK) 685 WebPageAccessibilityObject* m_accessibilityObject; 680 686 #endif 681 687 -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
r95901 r105503 31 31 #include "NotImplemented.h" 32 32 #include "WebEvent.h" 33 #include "WebPageAccessibilityObject.h" 34 #include "WebPageProxyMessages.h" 33 35 #include "WindowsKeyboardCodes.h" 34 36 #include <WebCore/FocusController.h> … … 38 40 #include <WebCore/PlatformKeyboardEvent.h> 39 41 #include <WebCore/Settings.h> 42 #include <wtf/gobject/GOwnPtr.h> 40 43 41 44 using namespace WebCore; … … 45 48 void WebPage::platformInitialize() 46 49 { 47 notImplemented(); 50 // Create the accessible object (the plug) that will serve as the 51 // entry point to the Web process, and send a message to the UI 52 // process to connect the two worlds through the accessibility 53 // object there specifically placed for that purpose (the socket). 54 m_accessibilityObject = webPageAccessibilityObjectNew(this); 55 GOwnPtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject))); 56 send(Messages::WebPageProxy::BindAccessibilityTree(String(plugID.get()))); 57 } 58 59 void WebPage::updateAccessibilityTree() 60 { 61 if (!m_accessibilityObject) 62 return; 63 64 webPageAccessibilityObjectRefresh(m_accessibilityObject); 48 65 } 49 66 -
trunk/Tools/ChangeLog
r105500 r105503 1 2012-01-20 Mario Sanchez Prada <msanchez@igalia.com> 2 3 [GTK] Expose accessibility hierarchy in WebKit2 to ATK/AT-SPI based ATs 4 https://bugs.webkit.org/show_bug.cgi?id=72589 5 6 Reviewed by Martin Robinson. 7 8 Ensure the accessibility infrastructure is available when running 9 the unit tests, otherwise WK2's accessibility tests won't work. 10 11 * Scripts/run-gtk-tests: 12 (TestRunner): 13 (TestRunner._lookup_atspi2_binary): New. Looks for the directory 14 where at-spi2's stuff is located (like at-spi-bus-launcher and 15 at-spi2-registryd). 16 (TestRunner.run): Initialize the accessibility infrastructure. 17 18 * gtk/generate-gtkdoc: 19 (get_webkit2_options): Add 'WebKitWebViewBaseAccessible.*'. 20 21 * gtk/jhbuild.modules: Added at-spi2-core and at-spi2-atk. 22 1 23 2012-01-20 Hayato Ito <hayato@chromium.org> 2 24 -
trunk/Tools/Scripts/run-gtk-tests
r103943 r105503 26 26 TEST_DIRS = [ "unittests", "WebKit2APITests" ] 27 27 # FIXME: https://bugs.webkit.org/show_bug.cgi?id=74717 28 SKIPPED = [ "unittests/testdownload", "unittests/testwebview", "unittests/testwebresource" ]28 SKIPPED = [ "unittests/testdownload", "unittests/testwebview", "unittests/testwebresource" ] 29 29 30 30 def __init__(self): … … 65 65 self._tests.append(test_path) 66 66 67 def _lookup_atspi2_binary(self, jhbuild_path, filename): 68 exec_prefix = self._executive.run_command([jhbuild_path ,'pkg-config', '--variable=exec_prefix', 'atspi-2']).rstrip('\r\n') 69 paths_to_check = [ 'libexec', 70 'lib/at-spi2-core', 71 'lib32/at-spi2-core' 72 'lib64/at-spi2-core' ] 73 for path in paths_to_check: 74 filepath = os.path.join(exec_prefix, path, filename) 75 if os.path.isfile(filepath): 76 return filepath 77 78 return None 79 67 80 def run(self): 68 81 if not self._tests: … … 79 92 80 93 jhbuild_path = os.path.join(self._gtk_tools_directory, "run-with-jhbuild") 94 95 # Make sure there's no AT_SPI_BUS X's property previously set, 96 # otherwise the accessibility bus couldn't be properly launched. 97 self._executive.run_command(['xprop', '-root', '-remove', 'AT_SPI_BUS'], env=test_env) 98 99 # Make sure the accessibility bus is launched. 100 a11y_bus_launched = False 101 a11y_bus_launcher_path = self._lookup_atspi2_binary(jhbuild_path, 'at-spi-bus-launcher') 102 if a11y_bus_launcher_path: 103 try: 104 a11y_bus_launcher = Executive().popen([a11y_bus_launcher_path], env=test_env) 105 a11y_bus_launched = True 106 except: 107 sys.stderr.write("Failed to launch the accessibility bus\n") 108 sys.stderr.flush() 109 110 a11y_registryd_running = False 111 a11y_registryd_path = self._lookup_atspi2_binary(jhbuild_path, 'at-spi2-registryd') 112 if a11y_registryd_path: 113 try: 114 a11y_registryd = Executive().popen([a11y_registryd_path], env=test_env) 115 a11y_registryd_running = True 116 except: 117 sys.stderr.write("Failed to run the accessibility registry\n") 118 sys.stderr.flush() 119 81 120 for test in self._tests: 82 121 out = self._executive.run_command([jhbuild_path ,'gtester', test], env=test_env, … … 84 123 sys.stdout.write(out) 85 124 sys.stdout.flush() 125 126 if a11y_registryd_running: 127 a11y_registryd.kill() 128 if a11y_bus_launched: 129 a11y_bus_launcher.kill() 86 130 87 131 if exit_status[0]: -
trunk/Tools/gtk/generate-gtkdoc
r103938 r105503 63 63 glob.glob(src_path('WebKitUIClient.*')) + \ 64 64 glob.glob(src_path('WebKitWebLoaderClient.*')) + \ 65 glob.glob(src_path('WebKitWebViewBaseAccessible.*')) + \ 65 66 glob.glob(src_path('tests/*.h')) 66 67 }) -
trunk/Tools/gtk/jhbuild.modules
r105075 r105503 15 15 <dep package="gnome-icon-theme"/> 16 16 <dep package="libsoup"/> 17 <dep package="at-spi2-core"/> 18 <dep package="at-spi2-atk"/> 17 19 </dependencies> 18 20 </metamodule> … … 163 165 </autotools> 164 166 167 <autotools id="at-spi2-core"> 168 <branch module="pub/GNOME/sources/at-spi2-core/2.2/at-spi2-core-2.2.1.tar.xz" version="2.2.1" 169 repo="ftp.gnome.org" 170 hash="sha256:2a4129420decca3657e163a4dbb1a3cb28acafe32ea1292417fdd81084d48fac" 171 md5sum="183916373d6906ff6b220bd44d15ff97"> 172 </branch> 173 <dependencies> 174 <dep package="glib"/> 175 </dependencies> 176 </autotools> 177 178 <autotools id="at-spi2-atk"> 179 <branch module="pub/GNOME/sources/at-spi2-atk/2.2/at-spi2-atk-2.2.1.tar.xz" version="2.2.1" 180 repo="ftp.gnome.org" 181 hash="sha256:6677def34b16c9a28d6ad96473ea56a3c0e13aa968e584df004cd44c8691ea1a" 182 md5sum="19646097aca25a9c1b8ba7ab8d172916"> 183 </branch> 184 <dependencies> 185 <dep package="glib"/> 186 <dep package="at-spi2-core"/> 187 </dependencies> 188 </autotools> 189 165 190 </moduleset> -
trunk/configure.ac
r105059 r105503 289 289 CLUTTER_REQUIRED_VERSION=1.8.2 290 290 CLUTTER_GTK_REQUIRED_VERSION=1.0.2 291 ATSPI2_REQUIRED_VERSION=2.2.1 291 292 292 293 # Available modules … … 1049 1050 fi 1050 1051 1052 if test "$with_accelerated_compositing" = "clutter"; then 1053 PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= $CLUTTER_REQUIRED_VERSION) 1054 PKG_CHECK_MODULES([CLUTTER_GTK], 1055 [clutter-gtk-1.0 >= $CLUTTER_GTK_REQUIRED_VERSION]) 1056 1057 AC_SUBST(CLUTTER_CFLAGS) 1058 AC_SUBST(CLUTTER_LIBS) 1059 AC_SUBST(CLUTTER_GTK_CFLAGS) 1060 AC_SUBST(CLUTTER_GTK_LIBS) 1061 fi 1062 1063 # check if atspi2 is available (only needed for Webkit2 unit tests) 1064 if test "$enable_webkit2" = "yes"; then 1065 PKG_CHECK_MODULES([ATSPI2], 1066 [atspi-2 >= $ATSPI2_REQUIRED_VERSION], 1067 [have_atspi2=yes], [have_atspi2=no]) 1068 1069 AC_SUBST([ATSPI2_CFLAGS]) 1070 AC_SUBST([ATSPI2_LIBS]) 1071 fi 1072 1051 1073 # check for code coverage support 1052 1074 if test "$enable_coverage" = "yes"; then … … 1121 1143 # GStreamer feature conditional 1122 1144 AM_CONDITIONAL([USE_GSTREAMER], [test "$have_gstreamer" = "yes"]) 1145 1146 # ATSPI2 conditional 1147 AM_CONDITIONAL([HAVE_ATSPI2], [test "$have_atspi2" = "yes"]) 1123 1148 1124 1149 # Accelerated compositing conditional
Note: See TracChangeset
for help on using the changeset viewer.