It seems that the accessibility role returned by the MenuAccessibility class is 
not correct for top level menu.

Added a condition check to return the accessibility role as 
`NSAccessibilityMenuBarItemRole` in stead of `NSAccessibilityMenuRole` for top 
level menu whose parent is `menubar`. 

The solution works correctly for screen magnifier as well as voice over. 

A manual test case is added to verify the fix.

Note: Tried implementing few a11y methods to fix but for top level menu with 
`NSAccessibilityMenuRole` doesn't return the a11y label.

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

Commit messages:
 - JMenu A11Y Screen Magnifier Fix

Changes: https://git.openjdk.org/jdk/pull/13271/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13271&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8283404
  Stats: 114 lines in 2 files changed: 111 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/13271.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13271/head:pull/13271

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

Reply via email to