Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

savoptik
Copy link
Contributor

@savoptik savoptik commented Nov 24, 2021

Testing https://bugs.openjdk.java.net/browse/JDK-8271071
Step to reproduce

  1. Run SwingSet2 in JDK 18 ( I used b24 )
  2. Enable Voiceover.
  3. Select JTable demo
  4. Click any row in the table or select the first row . Observe that row is selected & VoiceOver reads the column values or navigate the columns one by one by pressing tab key. When the focus reaches the last column ( Favourite Food ) Observe that column value is read as null. If you hear the same then the bug is reproduced.

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8277497: Last column cell in the JTable row is read as empty cell

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 24, 2021

👋 Welcome back asemenov! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@savoptik
Copy link
Contributor Author

/reviewer credit @forantar @azuev-java @pankaj-bansal

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 24, 2021
@openjdk
Copy link

openjdk bot commented Nov 24, 2021

@savoptik
Reviewer ant successfully credited.

Reviewer kizune successfully credited.

Reviewer pbansal successfully credited.

@openjdk
Copy link

openjdk bot commented Nov 24, 2021

@savoptik The following label will be automatically applied to this pull request:

  • client

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.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Nov 24, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 24, 2021

Webrevs

@@ -1086,6 +1080,15 @@ public String getAccessibleName() {
if (name == null) {
name = super.getAccessibleName();
}

Copy link
Contributor

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.

Copy link
Contributor Author

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");
}
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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".

@forantar
Copy link
Contributor

Looks fine to me.

@openjdk
Copy link

openjdk bot commented Nov 25, 2021

@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:

8277497: Last column cell in the JTAble row is read as empty cell

Reviewed-by: ant, kizune, pbansal

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 master branch:

  • 5045eb5: 8278273: Remove unnecessary exclusion of doclint accessibility checks
  • 587e540: 8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\s+- waiting to lock <0x[0-9a-f]+> (a java.lang.Class ...'
  • 082fdf4: 8172065: javax/swing/JTree/4908142/bug4908142.java The selected index should be "aad"
  • ab78187: 8277105: Inconsistent handling of missing permitted subclasses
  • adf3952: 8277372: Add getters for BOT and card table members
  • 7c6f57f: 8275610: C2: Object field load floats above its null check resulting in a segfault
  • a885aab: 8276125: RunThese24H.java SIGSEGV in JfrThreadGroup::thread_group_id
  • 6994d80: 8278291: compiler/uncommontrap/TraceDeoptimizationNoRealloc.java fails with release VMs after JDK-8154011
  • 286a26c: 8278277: G1: Simplify implementation of G1GCPhaseTimes::record_or_add_time_secs
  • d14f06a: 8278031: MultiThreadedRefCounter should not use relaxed atomic decrement
  • ... and 196 more: https://git.openjdk.java.net/jdk/compare/8051041eb2b3d70d4cc62b6f2726279d51e44733...master

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 /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 25, 2021
name = ac.getAccessibleName();
}
}
if ((name == null) || name.isEmpty()) {
Copy link
Member

@mrserb mrserb Dec 1, 2021

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).

Copy link
Member

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.

Copy link
Contributor Author

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.

@savoptik
Copy link
Contributor Author

savoptik commented Dec 6, 2021

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 6, 2021
@openjdk
Copy link

openjdk bot commented Dec 6, 2021

@savoptik
Your change (at version f5f1ac1) is now ready to be sponsored by a Committer.

@forantar
Copy link
Contributor

forantar commented Dec 6, 2021

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 6, 2021

Going to push as commit 70bad89.
Since your change was applied there have been 206 commits pushed to the master branch:

  • 5045eb5: 8278273: Remove unnecessary exclusion of doclint accessibility checks
  • 587e540: 8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\s+- waiting to lock <0x[0-9a-f]+> (a java.lang.Class ...'
  • 082fdf4: 8172065: javax/swing/JTree/4908142/bug4908142.java The selected index should be "aad"
  • ab78187: 8277105: Inconsistent handling of missing permitted subclasses
  • adf3952: 8277372: Add getters for BOT and card table members
  • 7c6f57f: 8275610: C2: Object field load floats above its null check resulting in a segfault
  • a885aab: 8276125: RunThese24H.java SIGSEGV in JfrThreadGroup::thread_group_id
  • 6994d80: 8278291: compiler/uncommontrap/TraceDeoptimizationNoRealloc.java fails with release VMs after JDK-8154011
  • 286a26c: 8278277: G1: Simplify implementation of G1GCPhaseTimes::record_or_add_time_secs
  • d14f06a: 8278031: MultiThreadedRefCounter should not use relaxed atomic decrement
  • ... and 196 more: https://git.openjdk.java.net/jdk/compare/8051041eb2b3d70d4cc62b6f2726279d51e44733...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 6, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Dec 6, 2021
@openjdk
Copy link

openjdk bot commented Dec 6, 2021

@forantar @savoptik Pushed as commit 70bad89.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants