RFR: 8361283: [Accessibility, macOS, VoiceOver] VoiceOver announced Tab items of JTabbedPane as RadioButton on macOS [v2]
Abhishek Kumar
abhiscxk at openjdk.org
Fri Jul 11 07:04:40 UTC 2025
On Tue, 8 Jul 2025 08:28:31 GMT, Artem Semenov <asemenov at openjdk.org> wrote:
>> The accessible class created for a java role `pagetab` i.e. a tab component is `CommonComponentAccessibility`.
>> The parent for `pagetab` is `TabGroupAccessibility` and the object returned from `rowRolesMapForParent` is `null` for `TabGroupAccessibility` in `getComponentAccessibilityClass` method. Since there is no entry in the `rolesMap` for the `pagetab` role, the returned class is `CommonComponentAccessibility`.
>> So, the `accessibilityRoleDescription` API is invoked from `CommonComponentAccessibility` and not from `TabButtonAccessibility`.
>
> Thank you for the reference! However, I would like to advise you to thoroughly examine the code of TabGroupAccessibility. This is because it has its own implementations for creating child components.
>
> Therefore, I am once again asking you to try to investigate the situation in more detail. There is a possibility that the mechanism is broken, and TabGroupAccessibility is not being created or used at all, which is incorrect.
>
> Additionally, all objects in the hierarchy of native objects inherit from CommonComponentAccessibility in one way or another. If the accessibilityRoleDescription selector is not defined in TabGroupAccessibility, it may not be called.
>
> I don’t have a Mac at hand right now; otherwise, I would debug this case myself and provide more detailed assistance.
TabButtonAccessibility is initialized in TabGroupAccessibility but since TabButtonAccessibility is not exposed to accessible system (i.e. not createdwithaccessible) and hence a11y subsystem in unable to invoke the method.
> TabGroupAccessibility is not being created or used at all, which is incorrect.
TabGroupAccessibility does get created and the APIs are invoked by a11y subsystem. Once the accessibilityRoleDescription selector is defined in TabGroupAccessibility, it gets called but only when the self javarole is `pagetablist`.
After adding an entry for TabButtonAccessibility in rolesMap`[rolesMap setObject:@"TabButtonAccessibility" forKey:@"pagetab"]`, creates an accessible component for TabButtonAccessibility instead of CommonComponentAccessibility and is exposed to get invoked by a11y client. Then accessibilityRoleDescription API is invoked by a11y client.
But I am yet to find if there is any repercussion of adding the entry for TabButtonAccessibility.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26096#discussion_r2199824512
More information about the client-libs-dev
mailing list