Hi Ambarish,
I have few observations
I think underscore (_) should be removed from newly added function names as it
is not there in any other function.
if (beforeIndex >= childrenCount) {
this check is not required inside else condition in
get_nonVisibleChildrenCountBeforeIndex(AccessibleContext parentAC, int
beforeIndex as this case is being handled by the if part of loop.
You should be able to reuse get_NonVisibleTargetCountBeforeIndex(Object[]
targets, int indexBefore) inside getAccessibleRelationTargetCount instead of
writing separate loop there.
|| beforeIndex < 0
is added in if loop in get_nonVisibleChildrenCountBeforeIndex(AccessibleContext
parentAC, int beforeIndex), but not added in
get_NonVisibleTargetCountBeforeIndex(Object[] targets, int indexBefore) {. Is
this intentional?
Regards,
Pankaj
From: Ambarish Rapte
Sent: Tuesday, September 10, 2019 11:30 PM
To: [email protected]
Subject: <AWT Dev> [14] RFR : 8226253 : JAWS reports wrong number of radio
buttons when buttons are hidden.
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