[webkit-dev] Root (accessible) element in WebKitGtk+

Mario Sanchez Prada msanchez at igalia.com
Thu Apr 29 02:08:59 PDT 2010


I've recently started to look at a11y issues in WebKitGtk (nothing too
impressive, just taking a look by the moment :-)), and I found the
implementation a bit strange, and not sure whethers there's a reason for
that I'm missing (most likely, I'd say):

// WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp

AccessibilityUIElement AccessibilityController::rootElement()
    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);

    // The presumed, desired rootElement is the parent of the web view.
    GtkWidget* webViewParent = gtk_widget_get_parent(GTK_WIDGET(view));
    AtkObject* axObject = gtk_widget_get_accessible(webViewParent);
    return AccessibilityUIElement(axObject);

As far as I can understand that code, the AtkObject being returned here
is the a11y object for the parent of the WebView widget, which it's
going to be another GtkWidget, most likely an GtkVBox, or some kind of
container like that.

However, as I can extract from the (a11y) tests, the root element should
return instead the a11y object associated to the root of the document
being rendered, which seems to be the <body> element, as far as I can
understand from other similar tests.

Hence, if my guessings are right, that would mean the implementation of
this function would be wrong and that perhaps some kind of solution as
the proposed in the attached patch would be a better one, but not sure
enough yet as to file a bug, so I'd appreaciate if someone could shed
some light on this topic before.

So that's it... any idea/comment on this?

Thanks in advance,

PS: FYI, the proposed patch gets the same results wrt a11y tests (same
number of failed/succeeded tests) with just a difference: the test
aria-controls-with-tabs.html stops outputting the following error to

atk_object_ref_accessible_child: assertion `ATK_IS_OBJECT (accessible)'
atk_object_ref_accessible_child: assertion `ATK_IS_OBJECT (accessible)'
atk_object_ref_accessible_child: assertion `ATK_IS_OBJECT (accessible)'

So maybe it's not a so bad patch after all :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reimplement-rootElement.patch
Type: text/x-patch
Size: 3086 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100429/35d0cfb7/attachment.bin>

More information about the webkit-dev mailing list