-
Notifications
You must be signed in to change notification settings - Fork 543
8313556: Create implementation of NSAccessibilitySlider protocol #1226
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
Create implementation for Slider and Stepper accessibility protocols. Fix mapping. Fix performAction parameter type in declaration.
|
👋 Welcome back kizune! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
/issue add JDK-8313558 |
|
@azuev-java |
|
Reviewers: @arapte @andy-goryachev-oracle |
|
/reviewers 2 |
|
@kevinrushforth |
|
should there be an automated test for the added functionality? |
Automated testing of the screen reader is not feasible. Even if it were, it would be a separate enhancement to add accessibility tests. Btw, this PR isn't providing new functionality. It is providing a new implementation of existing functionality. Having said that, it would be helpful for Alex to list the controls that will use the new implementation, so reviewers can test it manually. For this PR, I would imagine that the |
|
Thank you for clarification, Kevin. |
|
Yes, you read it correctly. Good question about how you can tell that it is going through the new implementation. Since it is supposed to transparently do the same thing, the only way I can think of is to instrument the code to add debug logging statement (which is what I did when reviewing the initial changes). |
|
perhaps the logging statements should be added (commented out) as a part of this PR. |
I can do that - i usually refrained from doing so because code would look not very clean but basically the only way to tell that it goes trough the new code should be debug output - if behavior changes it should be considered as a potential bug (not always because if i see that the old behavior is incorrect i would not go out of my way to recreate the obviously flawed logic) but in general the idea is that new code should behave exactly the same as the old one. |
|
what I meant is that commented out logging statements should be left in the code, so the reviewers can uncomment them and test. like this: |
I will definitely do that in the future. In this case you are right the controls are Spinner and Slider and while we have a dedicated control group for Spinner component in Ensemble there is no such thing for Slider (or i haven't found it) so the best way to test it is to go to the ColorPicker component test, invoke color chooser and click "Custom Color..." link - that will invoke the color selection dialog that has a lot of sliders to play with. |
Did that. I would just appreciate if you or any other reviewer reminds me to remove these statements after we are done with the review :) The code should print out when slider or stepper values are being changed using the a11y shortcuts to manipulate controls. That will ensure that when being accessed trough the a11y handle the component state can be appropriately updated. And of course it will indicate that the new component is invoked. |
|
I observed few warnings and behavioral differences.
|
|
Testing with macOS 13.3.1a and Voice Over, using MonkeyTester Observed a number of things, some possibly not related to this PR:
2023-08-31 08:09:03.087 java[45918:3234828] Slider decrement action invoked
|
|
@azuev-java This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@azuev-java This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
- Removed some debug output generation
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... Tested the behavior of both controls, observed no problem.
Providing a minor query, If you choose to make the change I shall re-approve.
| - (id)accessibilityTitle | ||
| { | ||
| jobject jresult = NULL; | ||
| GET_MAIN_JENV; | ||
| if (env == NULL) return NULL; | ||
| jresult = (jobject)(*env)->CallLongMethod(env, self->jAccessible, | ||
| jAccessibilityAttributeValue, (jlong)@"AXTitle"); | ||
| GLASS_CHECK_EXCEPTION(env); | ||
| return variantToID(env, jresult); | ||
| } |
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 method is same as accessibilityLabel. Should we change implementation to call one method from the other ?
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.
Makes sense.
|
With Slider, it announces the current value as "percent" (of the working envelope?), even though the min/max can be arbitrary. Is this intentional? Also, for Spinner, it says "Stepper", is this expected? macOS 15.3.1 M1 |
|
Is this PR related to https://git.openjdk.org/jdk/pull/23841 in any way? |
I need to check that. |
Not directly. The event delivery in AWT/Swing and in JavaFX works quite differently so i will check if the new implementation here is affected by the same problem - but i doubt so. |
On macOS the control we call Spinner is called Stepper, there's no Spinner. From macOS UI guide: "A stepper is a two-segment control that people use to increase or decrease an incremental value." |
yep, that's what I suspected. thanks! so the remaining question is whether it should announce "percent" of the slider position or the actual value? |
…bilityTitle and add coment explaining why.
Unfortunately we do not have any control on that. There is no way to tell VoiceOver if it is percent or the raw value - VO deducts it based on its own logic. The only way to customize the VO heuristics is to override accessibilityValueDescription function and return string for VO but then we would need to decode for ourselves how do we convert the value plus it will be our responsibility to do localization of this string if needed. |
andy-goryachev-oracle
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.
yep, you are right: we don't want to deal with interpreting and l10n.
|
/integrate |
|
@azuev-java |
|
/sponsor |
|
Going to push as commit c7091e1.
Your commit was automatically rebased without conflicts. |
|
@arapte @azuev-java Pushed as commit c7091e1. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Create implementation for Slider and Stepper accessibility protocols.
Fix mapping.
Fix performAction parameter type in declaration.
Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1226/head:pull/1226$ git checkout pull/1226Update a local copy of the PR:
$ git checkout pull/1226$ git pull https://git.openjdk.org/jfx.git pull/1226/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1226View PR using the GUI difftool:
$ git pr show -t 1226Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1226.diff
Using Webrev
Link to Webrev Comment