RESOLVED FIXED Bug 230259
[GTK][a11y] Add initial WTR accessibility support when building with ATSPI
https://bugs.webkit.org/show_bug.cgi?id=230259
Summary [GTK][a11y] Add initial WTR accessibility support when building with ATSPI
Carlos Garcia Campos
Reported 2021-09-14 05:41:05 PDT
Add WTR support to run the layout tests.
Attachments
Patch (57.59 KB, patch)
2021-10-25 03:27 PDT, Carlos Garcia Campos
no flags
Patch (56.79 KB, patch)
2021-10-29 01:07 PDT, Carlos Garcia Campos
no flags
Patch (56.78 KB, patch)
2021-11-05 03:36 PDT, Carlos Garcia Campos
aperez: review+
Carlos Garcia Campos
Comment 1 2021-10-25 03:27:12 PDT
Andres Gonzalez
Comment 2 2021-10-27 08:52:07 PDT
(In reply to Carlos Garcia Campos from comment #1) > Created attachment 442353 [details] > Patch --- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp +++ a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp @@ -246,7 +246,11 @@ void* WKAccessibilityRootObject(WKBundlePageRef pageRef) #if ENABLE(ACCESSIBILITY) if (!pageRef) return 0; - + +#if USE(ATSPI) + return WebKit::toImpl(pageRef)->accessibilityRootObject().child(); +#endif Why the root obtained down below doesn't work for ATSPI? WebCore::AXCoreObject* root = core.document()->axObjectCache()->rootObject(); if (!root) return 0; return root->wrapper();
Andres Gonzalez
Comment 3 2021-10-27 08:56:40 PDT
@@ -273,7 +277,11 @@ void* WKAccessibilityFocusedObject(WKBundlePageRef pageRef) #if ENABLE(ACCESSIBILITY) if (!pageRef) return 0; - + +#if USE(ATSPI) + return WebKit::toImpl(pageRef)->accessibilityRootObject().focusedObject(); +#endif Same question here. Why this is not good for ATSPI? auto* focusedObject = axObjectCache->focusedUIElementForPage(page); if (!focusedObject) return 0; return focusedObject->wrapper();
Carlos Garcia Campos
Comment 4 2021-10-28 01:51:16 PDT
(In reply to Andres Gonzalez from comment #2) > (In reply to Carlos Garcia Campos from comment #1) > > Created attachment 442353 [details] > > Patch > > --- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp > +++ a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp > @@ -246,7 +246,11 @@ void* WKAccessibilityRootObject(WKBundlePageRef pageRef) > #if ENABLE(ACCESSIBILITY) > if (!pageRef) > return 0; > - > + > +#if USE(ATSPI) > + return WebKit::toImpl(pageRef)->accessibilityRootObject().child(); > +#endif > > Why the root obtained down below doesn't work for ATSPI? > > WebCore::AXCoreObject* root = > core.document()->axObjectCache()->rootObject(); > if (!root) > return 0; > > return root->wrapper(); In the web process the web page has an accessibility object that is the parent of the root object. In case of ATK that's WebKitWebPageAccessibilityObject, in atspi it's WebCore::AccessibilityRootAtspi. When running layout tests we don't really need a parent for the root object, but in atspi WebCore::AccessibilityRootAtspi contains the AccessibilityAtspi object that implements the communication with atspi service. So, all wrappers expect to have a valid root that they use to talk to atspi service. In case of ATK, when tests are run the web page accessibility object is never connected to the root object wrapper, but in atspi we need to make that connection that happens in AccessibilityRootAtspi::child(). That's why we get the root object wrapper as the child of the web page accessibility object (the root of the tree in the web process).
Carlos Garcia Campos
Comment 5 2021-10-29 01:07:42 PDT
Carlos Garcia Campos
Comment 6 2021-11-05 03:36:27 PDT
Adrian Perez
Comment 7 2021-11-15 02:03:50 PST
Comment on attachment 443386 [details] Patch There has not been further comments by Andres, and the patch and clarifications LGTM, so let's try and get this landed :)
Carlos Garcia Campos
Comment 8 2021-11-18 03:46:20 PST
Note You need to log in before you can comment on or make changes to this bug.