Bug 272565 - AX: Support AXActiveElement and AXSelectedChildren Mac APIs for comboboxes, lists and listboxes.
Summary: AX: Support AXActiveElement and AXSelectedChildren Mac APIs for comboboxes, l...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
: 244093 257273 264891 267038 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-11 18:34 PDT by Andres Gonzalez
Modified: 2024-06-10 08:07 PDT (History)
15 users (show)

See Also:


Attachments
Patch (52.28 KB, patch)
2024-04-11 18:48 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (56.63 KB, patch)
2024-04-12 08:32 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (59.55 KB, patch)
2024-04-15 19:15 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (59.55 KB, patch)
2024-04-16 06:32 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (60.30 KB, patch)
2024-04-17 08:36 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (60.40 KB, patch)
2024-04-17 18:49 PDT, Andres Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Gonzalez 2024-04-11 18:34:10 PDT
.
Comment 1 Radar WebKit Bug Importer 2024-04-11 18:34:19 PDT
<rdar://problem/126318573>
Comment 2 Andres Gonzalez 2024-04-11 18:48:23 PDT
Created attachment 470879 [details]
Patch
Comment 3 Andres Gonzalez 2024-04-12 08:32:44 PDT
Created attachment 470897 [details]
Patch
Comment 4 Dominic Mazzoni 2024-04-12 10:20:32 PDT
Comment on attachment 470897 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=470897&action=review

> Source/WebCore/accessibility/AXCoreObject.cpp:361
> +    if (isList() || isListBox()) {

While less common, the ARIA spec allows the popup element associated with the combobox to be a listbox, tree, grid, or dialog. I'm not sure how dialog applies here, but I feel like you should support tree and grid here because they're pretty analogous to listbox. I'm assuming also tree grid.

> Source/WebCore/accessibility/AXObjectCache.cpp:2363
> +    } else if (object->isList() || object->isListBox())

Again, support grid, tree, tree grid here.

Or maybe you can more generally just call supportsActiveDescendant? Do we want to do this case for any container that supports active descendant?

> Source/WebCore/accessibility/AXObjectCache.cpp:2398
> +    // Table cell active descendant changes should trigger selected cell changes.

I think tables should be handled like grids and list boxes

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1035
> +        [tempArray addObject:NSAccessibilityActiveElementAttribute];

Let's make sure we add this to all roles that support active descendant, which is quite large in the spec. It even includes things like application, group, tablist, and spin button.

Maybe it'd be easier to add this in _additionalAccessibilityAttributeNames by calling supportsActiveDescendant?
Comment 5 Andres Gonzalez 2024-04-15 19:15:55 PDT
Created attachment 470933 [details]
Patch
Comment 6 Andres Gonzalez 2024-04-15 19:26:33 PDT
(In reply to Dominic Mazzoni from comment #4)
> Comment on attachment 470897 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=470897&action=review
> 
> > Source/WebCore/accessibility/AXCoreObject.cpp:361
> > +    if (isList() || isListBox()) {
> 
> While less common, the ARIA spec allows the popup element associated with
> the combobox to be a listbox, tree, grid, or dialog. I'm not sure how dialog
> applies here, but I feel like you should support tree and grid here because
> they're pretty analogous to listbox. I'm assuming also tree grid.

AG: added the canBeControlledBy(AccessibilityRole) method to accomplished this.

> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:2363
> > +    } else if (object->isList() || object->isListBox())
> 
> Again, support grid, tree, tree grid here.
> 
> Or maybe you can more generally just call supportsActiveDescendant? Do we
> want to do this case for any container that supports active descendant?

AG: added the method supportsActiveDescendant but want to keep the scope of this change limited to combobox-related elements. Will add other relevant roles in a separate patch.

> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:2398
> > +    // Table cell active descendant changes should trigger selected cell changes.
> 
> I think tables should be handled like grids and list boxes

AG: I want to limit the scope of this patch to combobox-related elements. Will address tables in a separate patch.

> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1035
> > +        [tempArray addObject:NSAccessibilityActiveElementAttribute];
> 
> Let's make sure we add this to all roles that support active descendant,
> which is quite large in the spec. It even includes things like application,
> group, tablist, and spin button.
> 
> Maybe it'd be easier to add this in _additionalAccessibilityAttributeNames
> by calling supportsActiveDescendant?

AG: done. Thanks for the review.
Comment 7 Andres Gonzalez 2024-04-16 06:32:51 PDT
Created attachment 470936 [details]
Patch
Comment 8 Andres Gonzalez 2024-04-17 08:36:18 PDT
Created attachment 470960 [details]
Patch
Comment 9 Andres Gonzalez 2024-04-17 18:49:28 PDT
Created attachment 470973 [details]
Patch
Comment 10 EWS 2024-04-17 20:23:22 PDT
Committed 277649@main (cedc4e8d1b60): <https://commits.webkit.org/277649@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 470973 [details].
Comment 11 Andres Gonzalez 2024-04-30 13:21:36 PDT
*** Bug 257273 has been marked as a duplicate of this bug. ***
Comment 12 Andres Gonzalez 2024-04-30 13:26:20 PDT
*** Bug 264891 has been marked as a duplicate of this bug. ***
Comment 13 Andres Gonzalez 2024-04-30 13:28:41 PDT
*** Bug 267038 has been marked as a duplicate of this bug. ***
Comment 14 Andres Gonzalez 2024-06-10 08:07:19 PDT
*** Bug 244093 has been marked as a duplicate of this bug. ***