Summary: | [GTK][a11y] Add initial WTR accessibility support when building with ATSPI | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | aboxhall, andresg_22, aperez, apinheiro, bugs-noreply, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white | ||||||||
Priority: | P2 | Keywords: | Gtk | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | 230256, 232141 | ||||||||||
Bug Blocks: | 230253, 232300 | ||||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2021-09-14 05:41:05 PDT
Created attachment 442353 [details]
Patch
(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(); @@ -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(); (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). Created attachment 442792 [details]
Patch
Created attachment 443386 [details]
Patch
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 :)
Committed r285996 (244393@main): <https://commits.webkit.org/244393@main> |