On Wed, 22 Nov 2023 17:05:36 GMT, Ambarish Rapte <[email protected]> wrote:
>> Currently we use the value of spinner as it's `UIA_NamePropertyId` when a11y
>> client application requests for it.
>> Ideally we should use the text set by `Node.setAccessibleText()` as the
>> `UIA_NamePropertyId`.
>> For other controls such as Slider, ListView we use the text set by
>> setAccessibleText() API.
>>
>> Fix:
>> Use the text set by `Node.setAccessibleText()` as the `UIA_NamePropertyId`.
>> This means, when a11y client requests `UIA_NamePropertyId`, which is mapped
>> to AccessibleAttribute.TEXT attribute, we shall return the accessible text.
>> So we need another way to read out the VALUE of the Spinner.
>> - For this we need to implement `IValueProvider` pattern for Spinner control
>> - IValueProvider requests the value of the control using it's API
>> `get_ValueString()`
>> - It required to introduce a new AccessibleAttribute `VALUE_STRING`
>> - IValueProvider also reads out if the control is editable or not, hence
>> added `EDITABLE `case in `Spinner.queryAccessibleAttribute()`
>>
>> Verification:
>> - Run any spinner app, with setAccessibleText set on spinner
>> - Run Windows narrator and observe
>> - Without this fix:
>> - 1. Narrator does not read the text set by setAccessibleText
>> - 2. In application "Accessibility Insights for Windows", you can see the
>> value of Spinner as the Name property
>> - After this fix:
>> - 1. Narrator reads the accessible text then value of Spinner and then if
>> editable or not
>> - 2. In application "Accessibility Insights for Windows", you can see the
>> text set by `setAccessibleText()` for Spinner as the Name property and the
>> Spinner's value as value property
>
> Ambarish Rapte has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Mac a11y change for VALUE_STRING attribute for Spinner
The changes look good and everything works as I would expect. I left one
question, but it is fine as you have it.
modules/javafx.graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java
line 805:
> 803: break;
> 804: case VALUE_STRING:
> 805: if (getAttribute(ROLE) == AccessibleRole.SPINNER) {
Why qualify this by the AccessibleRole? Might there be other controls in the
future that report `VALUE_STRING`?
-------------
Marked as reviewed by kcr (Lead).
PR Review: https://git.openjdk.org/jfx/pull/1291#pullrequestreview-1760705697
PR Review Comment: https://git.openjdk.org/jfx/pull/1291#discussion_r1412663310