RFR: 8377428: VoiceOver Cursor Navigates Invisible Components [v2]

Jeremy Wood jwood at openjdk.org
Tue Feb 10 01:07:46 UTC 2026


> This PR prevents VoiceOver from letting me navigate the VoiceOver cursor to hidden components.
> 
> ### Technical Details
> 
> VoiceOver is responsible for a call to `CAccessibility.getChildrenAndRoles(JFrame, JFrame, JAVA_AX_ALL_CHILDREN, false)`.
> 
> That last boolean is `allowIgnored`.
> 
> When `allowedIgnored == false` we already omitted certain components based on their AccessibleRole. This PR expands our definition of "what should be ignored" to include invisible Components.
> 
> ### Other Considerations
> 
> 1. Originally I thought the resolution to this problem would be to change JAVA_AX_ALL_CHILDREN to JAVA_AX_VISIBLE_CHILDREN . And maybe that's still a viable option, but after some research I've come to believe it's simpler/appropriate to change our definition of "ignored".
> 2. NSViews have a separate property `isHidden`. Another approach to this ticket might be to try to assign `myNSView.isHidden = !myJavaComponent.isVisible()`. Some reading suggests that this might (?) automatically resolve this ticket.

Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision:

 - 8377428: simplify test instructions
   
   Now that there are other interesting components in the UI: we don't need to press CTRL + ALT + UP.
 - 8377428: test condition where axComp is null
   
   If AccessibleComponent is null, when the new CAccessibility.isShowing(..) method falls back to consulting the AccessibleStateSet.
   
   This change makes sure we follow that code path, too.
   
   When I checked CAccessibility.isShowing() in the debugger, I observed:
   
   For "row 1": we had an AccessibleComponent where isShowing() is false
   
   For "row 2": we had a no AccessibleComponent. We checked the AccessibleStateSelection and did not see SHOWING, so CAccessibility.isShowing(context) returned TRUE. This is not accurate, but it's working as designed. We had incomplete information, and we're supposed to err on the side of returning true (to minimize invasive risk). Meanwhile: the test still passes, because then _addChildren recursively inspects the JButton, and CAccessibility.isShowing(buttonContext) returns false.
   
   For "row 3": we had an AccessibleComponent where isShowing() is true.
   
   For "row 4": we had no AccessibleComponent. We checked AccessibleStateSelection and DID see SHOWING, so we returned true.
   
   This is in response to:
   https://github.com/openjdk/jdk/pull/29630#discussion_r2784969123

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29630/files
  - new: https://git.openjdk.org/jdk/pull/29630/files/c4e9fc45..724050cd

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29630&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29630&range=00-01

  Stats: 60 lines in 1 file changed: 44 ins; 2 del; 14 mod
  Patch: https://git.openjdk.org/jdk/pull/29630.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29630/head:pull/29630

PR: https://git.openjdk.org/jdk/pull/29630


More information about the client-libs-dev mailing list