Hi,

Please review this fix,

JBS: https://bugs.openjdk.java.net/browse/JDK-8226253 

Webrev: http://cr.openjdk.java.net/~arapte/a11y/8226253/webrev.01/ 

 

Issue:

AccessibleContext.getAccessibleChildrenCount() returns number of all Accessible 
children, but does not take visibility of a child component in consideration.

 

Fix:

Do not consider children that are not showing when providing accessible 
children count and when providing an accessible child of the component to 
screen reader.

This change is needed for both AccessibleContext and AccessibleRelationSet.

The newly added methods do not result in creating the AccessibleContext of 
children components earlier than before the fix.

The AccessibleContext gets created in 
AccessibilityEventMonitor.AccessibilityEventListener.installListeners(AccessibleContext)
 method, which occurs before the newly added methods get executed.

 

Verification:

Tested the fix with JList with a custom AccessibleContext(custom ListModel) to 
hide non visible components, JRadioButton, JCheckBox, JToggleButton, 
JRadioButtonMenuItem, JCheckBoxMenuItem, JComboBox and SwingSet2.

Did not find any misbehavior with the fix.

 

 

Some pointers provided by Sergey in offline discussion:

1. Fix the issue on Java Access Bridge side. => 
http://cr.openjdk.java.net/~arapte/a11y/8226253/webrev.01/

2. Confirm that the fix does not create the AccessibleContext of children 
earlier than before the fix. => Does not happen

3. Test JList with a custom AccessibleContext. => Tested by adding a custom 
ListModel to JList. JList.AccessibleJList uses the ListModel for 
getAccessibleChildrenCount() and getAccessibleChild()

 

 

Regards,

Ambarish

Reply via email to