RFR: 8284544: [Win] Name-Property of Spinner cannot be changed
Kevin Rushforth
kcr at openjdk.org
Tue Nov 21 16:38:21 UTC 2023
On Mon, 20 Nov 2023 05:37:38 GMT, Ambarish Rapte <arapte at openjdk.org> 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
I left quick comment and a question inline.
modules/javafx.controls/src/main/java/javafx/scene/control/Spinner.java line 851:
> 849: case TEXT: {
> 850: String accText = getAccessibleText();
> 851: return (accText != null) ? accText : "";
Is there a better default than the empty string? What do we do for Slider and other similar controls?
modules/javafx.graphics/src/main/java/javafx/scene/AccessibleAttribute.java line 784:
> 782: * <li>Return Type: {@link String} </li>
> 783: * <li>Parameters: </li>
> 784: * </ul>
This will need `@since 22`
-------------
PR Review: https://git.openjdk.org/jfx/pull/1291#pullrequestreview-1742469093
PR Review Comment: https://git.openjdk.org/jfx/pull/1291#discussion_r1400867225
PR Review Comment: https://git.openjdk.org/jfx/pull/1291#discussion_r1400871632
More information about the openjfx-dev
mailing list