-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8341311: [Accessibility,macOS,VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu #25470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back abhiscxk! A progress list of the required criteria for merging this PR into |
|
@kumarabhi006 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 65 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@kumarabhi006 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
@azuev-java Please review the proposed fix. |
|
/dummy |
|
@kumarabhi006 Unknown command |
Webrevs
|
| * @run main/manual TestPopupMenuChildCount | ||
| */ | ||
|
|
||
| public class TestPopupMenuChildCount { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: as far as I understand, this is for macOS only. Do you think it would make more sense to have a name mention that the test is Mac only? The same for test description. Seems to me a bit confusing otherwise
It's fine with me if you leave it as it is though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is only for macOS and that is conveyed through the jtreg tag here. I don't think test name needs to be changed.
Although it is not essentially required but will update the test summary and instruction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is only for macOS and that is conveyed through the jtreg tag here. I don't think test name needs to be changed.
Although it is not essentially required but will update the test summary and instruction.
It seems to me that this test should be generalized for all a11y platforms, since it is a regression test and can help identify regression of this functionality on other platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behaviour on Windows with a11y clients (JAWS or NVDA) is different. They don't announce the child count for the menu and submenus for java application and it is similar to the native application (notepad++) too.
So, the regression test restricted for macOS seems suitable for now.
| AccessibleContext ac = a.getAccessibleContext(); | ||
| if (ac != null) { | ||
| Accessible aComp = null; | ||
| for (int i = 0; i < ac.getAccessibleChildrenCount(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest replacing for with while. If the desired submenu is at the beginning of the list, there’s no need to traverse it further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think even though the submenu is at the beginning but if it is not visible then we need to traverse further to check for other submenu if present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimized the code to not traverse further if the desired submenu is fetched. Verified the recent change with the test code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimized the code to not traverse further if the desired submenu is fetched. Verified the recent change with the test code.
You could, of course, put this in the while condition, but this way is also fine.
| JNIEnv *env = [ThreadUtilities getJNIEnv]; | ||
| GET_CACCESSIBILITY_CLASS_RETURN(nil); | ||
| DECLARE_STATIC_METHOD_RETURN(sjm_getCurrentAccessiblePopupMenu, sjc_CAccessibility, | ||
| "getCurrentAccessiblePopupMenu", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won’t it be possible to get the correct object like this, as it’s done in outlineRowAccessibility.m?
jobject currentAccessible = [self currentAccessibleWithENV:env];There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to utilize this method but getCurrentAccessiblePopupMenu throws NPE.
java.lang.NullPointerException: Cannot invoke "sun.swing.SwingAccessor$AccessibleComponentAccessor.getCurrentAccessible(javax.accessibility.AccessibleContext)" because the return value of "sun.swing.SwingAccessor.getAccessibleComponentAccessor()" is null
savoptik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
azuev-java
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@azuev-java @savoptik Created a new JBS bug JDK-8358121 to track the multi level submenu text announcement issue |
|
/integrate |
|
Going to push as commit e33eeee.
Your commit was automatically rebased without conflicts. |
|
@kumarabhi006 Pushed as commit e33eeee. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly.
Issue: Problem is with the a11y subsystem method call to get the accessible children details.
Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and
PostMenuOpenednotification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes theaccessibilityChildrenmethod to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect.Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the
accessibilityChildrenmethod is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details.Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline.
Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.Note : While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25470/head:pull/25470$ git checkout pull/25470Update a local copy of the PR:
$ git checkout pull/25470$ git pull https://git.openjdk.org/jdk.git pull/25470/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25470View PR using the GUI difftool:
$ git pr show -t 25470Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25470.diff
Using Webrev
Link to Webrev Comment