[Webkit-unassigned] [Bug 51932] GTK: AX: atk tests need to be updated after recent changes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 7 04:20:21 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=51932





--- Comment #7 from Mario Sanchez Prada <msanchez at igalia.com>  2011-01-07 04:20:22 PST ---
(In reply to comment #0)
> With the change to support WK2 accessibility, the root object of the AX hierarchy may be different from what GTK expects. 
> 
> Many of the atktests are failing because 
> 
> AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView));
> 
> is returning something different.

Yep, the problem is that now, with the new hierarchy, WebKitGTK is returning an 'unknown' object (from the POV of ATK roles) as the wrapper for the AXScrollView AccessibleObject.

In other words, WebKitGTK is returning the parent AtkObject of the object it should be returning instead (that would have the AtkRole ATK_ROLE_DOCUMENT_FRAME, instead of ATK_ROLE_UNKNOWN), so that's why ATK tests are failing now: the hierarchy is shifted.


> These tests (or some method) needs to be updated to reflect the new hierarchy
> 
> AXScrollView -> AXWebArea -> elements

Yes, however I wonder whether the actual fix for now (at least while WK2 is not supported in the GTK port) would be, instead of changing all the tests to expect such object as the root AtkObject, just to change the implementation of gtk_widget_get_accessible() in WebKitWebView so it actually keeps returning the old, well-known, AtkObject of role ATK_ROLE_DOCUMENT_FRAME.

That way we'd be obviously ignoring the new AXScrollView object in the GTK port, but I guess it could be a good enough solution while WK2 a11y is not supported in this port... or perhaps I'm missing something crucial and I'm just saying a completely stupid thing.

So, opinions?

Btw, a patch that would fix the issue by changing what gtk_widget_get_accessible() returns (tested to make testatk and testatkroles work fine again) would be something like this:

--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -1452,11 +1452,24 @@ static AtkObject* webkit_web_view_get_accessible(GtkWidget* widget)
     if (!doc)
         return NULL;

-    AccessibilityObject* coreAccessible = doc->axObjectCache()->rootObject();
-    if (!coreAccessible || !coreAccessible->wrapper())
+    AccessibilityObject* rootAccessible = doc->axObjectCache()->rootObject();
+    if (!rootAccessible)
         return NULL;

-    return coreAccessible->wrapper();
+    // We need to return the root accessibility object's first child
+    // to get to the actual ATK Object associated with the web view.
+    // See https://bugs.webkit.org/show_bug.cgi?id=51932
+    AtkObject* axRoot = rootAccessible->wrapper();
+    if (!axRoot || !ATK_IS_OBJECT(axRoot))
+        return NULL;
+
+    AtkObject* axWebView = atk_object_ref_accessible_child(ATK_OBJECT(axRoot), 0);
+    if (!axWebView || !ATK_IS_OBJECT(axWebView))
+        return NULL;
+
+    // We don't want the extra reference returned by ref_accessible_child.
+    g_object_unref(axWebView);
+    return axWebView;
 }

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list