-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8277497 Last column cell in the JTAble row is read as empty cell #6538
Conversation
👋 Welcome back asemenov! A progress list of the required criteria for merging this PR into |
/reviewer credit @forantar @azuev-java @pankaj-bansal |
@savoptik Reviewer Reviewer |
Webrevs
|
@@ -1086,6 +1080,15 @@ public String getAccessibleName() { | |||
if (name == null) { | |||
name = super.getAccessibleName(); | |||
} | |||
|
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.
Please remove the extra line.
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.
Done
if (((name == null) || name.isEmpty()) && | ||
(JLabel.this.getIcon() != null)) { | ||
name = ResourceBundle.getBundle("com.sun.accessibility.internal.resources.accessibility", Locale.getDefault()).getString("image"); | ||
} |
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.
Probably it should somehow ask the icon itself about possible description? I guess the JLabel should work similar to Icon/ImageIcon/AccessibleImageIcon/etc when the text is empty but the icon is set. But I am not sure that the iicons are supported by the a11y in Swing, for example how the reader will cover the simple Icon? Will it say something?
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.
Done. thank you very much.
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 few questions to thinking about:
- If the label and icon is not accessible then should we say something? Or we should ignore it like we do for any other non-accessible components?
- Why the image text is used, don't we need to use the "javax.accessibility.AccessibleRole#ICON" role for such label/icon and allow the reader to say something standard for the icon. Does the voiceover has some default text for the icon/image when the alt text is not set?
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.
Thank you very much. We've made a change. A comparison of the behavior before and after the changes is below.
On MAcOS.
State before our changes .:
- in a standalone label with an icon without text, VO says Image;
- in a standalone label with an icon with text VO speaks the text of the label;
- If a label without text with an icon is in the table VO says "Empty cell".
If you add just a role change:
- in a standalone label with an icon without text, VO says Image;
- in a standalone label with an icon with text VO speaks the text of the label;
- In the table for a label with an icon without text, when navigating horizontally, VO does not say anything;
- In the table for a label with an icon without text for vertical navigation, VO says "image cell".
Unacceptable option.
With a complete fix:
- in a standalone label with an icon without text, VO says Image;
- in a standalone label with an icon with text VO speaks the text of the label;
- In the table for a label with an icon without text, for any navigation, VO says "image".
ON Windows.
State before our changes:
- in a standalone label with an icon and text, the label text is spoken;
- in a standalone label with an icon without text, the label is skipped;
- In the table, a label with an icon without text is not spoken, the column heading is spoken.
With full patch:
- in a standalone label with an icon and text, the label text is spoken;
- in a standalone label with an icon without text the "Image icon" is spoken;
- In the table, a label with an icon without text is pronounced as "Image".
8966cff
to
09d3fa5
Compare
Looks fine to me. |
@savoptik 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 206 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@forantar, @azuev-java) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
name = ac.getAccessibleName(); | ||
} | ||
} | ||
if ((name == null) || name.isEmpty()) { |
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 continue our discussion from code line above.
Why for the empty label and non-accessible image we should say "image", and not for example the "empty label" or just ignore it?
I mean that if the icon used by the label does not have an "accessible" icon, or any other accessible component why we will try to mention it to the user?
If non-accessible component should not be mentioned to user then you do not need to add a new code here, we already have the "getAccessibleIcon" method which can be called for example from the "CAccessibility" every time we request name/description/text and it empty while the icon is not null and accessible - this will cover all accesible components not only JLabel.
BTW it could be a SwingSet/App bug that the provided image does not have a description (similar to the common bug in html when the image tag does not have an alt).
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 like If the change will be done in the "CAccessibility" it will cover the custom components as well.
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.
Thank you. We’ve considered your suggestion and found it reasonable. Indeed, it should be enough here to propagate the icon’s accessible name when it exists. Also, we will change SwingSet2 so that those icons had accessible names.
/integrate |
/sponsor |
Going to push as commit 70bad89.
Your commit was automatically rebased without conflicts. |
Testing https://bugs.openjdk.java.net/browse/JDK-8271071
Step to reproduce
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6538/head:pull/6538
$ git checkout pull/6538
Update a local copy of the PR:
$ git checkout pull/6538
$ git pull https://git.openjdk.java.net/jdk pull/6538/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6538
View PR using the GUI difftool:
$ git pr show -t 6538
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6538.diff