On Thu, 15 Jun 2023 15:58:18 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:

> The issue exist only for non-editable combobox and the root cause is 
> accessible object is not created due to incorrect index returned from 
> component class which results in no a11y API invoked.
> 
> Proposed solution is to return the correct accessible child from 
> getAccessibleChild method which is AquaComboBoxButton (arrowButton) instance 
> and that results in invoking the a11y APIs to return the current selected 
> item in combobox. 
> 
> Further when the application comes up first time the accessible name is not 
> set for current displayed item in JCombobox that is handled in 
> AquaComboBoxButton which will take care for the current selected item as well 
> as if user modifies the selection by drop-down list.
> 
> This fix results in few JCK test failure and that may require modification. I 
> have filed an issue against JCK 
> ([JCK-7319423](https://bugs.openjdk.org/browse/JCK-7319423)).  
> 
> CI link is posted in JBS.

@azuev-java @NikitkoCent please review.

src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java line 162:

> 160:             AccessibleContext ac = this.getAccessibleContext();
> 161:             if (ac != null && (comboBox.getSelectedItem() != null)) {
> 162:                 
> ac.setAccessibleName(comboBox.getSelectedItem().toString());

Why are you using the currently selected element for the button name and not a 
specific name? Whether it will sound right when using a screen reader. Wouldn't 
this be misleading to a blind user? Especially since it will only change when 
this method is called.

src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java line 162:

> 160:             AccessibleContext ac = this.getAccessibleContext();
> 161:             if (ac != null && (comboBox.getSelectedItem() != null)) {
> 162:                 
> ac.setAccessibleName(comboBox.getSelectedItem().toString());

Are you sure that the toString() method always provides a valid string, and not 
a descriptive JSON or some other character set that is useless for a blind user?

-------------

PR Review: https://git.openjdk.org/jdk/pull/14497#pullrequestreview-1483145861
PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1232051887
PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1232053721

Reply via email to