-
Notifications
You must be signed in to change notification settings - Fork 541
8361379: [macos] Refactor accessibility code to retrieve attribute by name #1840
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
… name - Copyright year update - Introduce new function requestNodeAttribute and refactor code to use it - Fix some typos - Enable new code to handle TabPages since TabGroup was implemented
|
👋 Welcome back kizune! A progress list of the required criteria for merging this PR into |
|
@azuev-java 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 10 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 |
Webrevs
|
|
@andy-goryachev-oracle @arapte please review |
|
/reviewers 2 |
|
@andy-goryachev-oracle |
| [rolesMap setObject:@"JFXRadiobuttonAccessibility" forKey:@"RADIO_BUTTON"]; | ||
| // Requires TAB_GROUP to be implemented first | ||
| // [rolesMap setObject:@"JFXRadiobuttonAccessibility" forKey:@"TAB_ITEM"]; | ||
| [rolesMap setObject:@"JFXRadiobuttonAccessibility" forKey:@"TAB_ITEM"]; |
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 change seems unrelated - is it a part of some other work?
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.
When i implemented radio buttons one of the roles this implementation was supposed to fulfill was tab button for the tabbed pane. But without the new implementation of Tab Group it did not work - focus was funky and announcement was not correct. So i commented out this role assignment. When i pushed Tab Group implementation i haven't uncommented this line so now since i do clean up and refactoring on this exact file i tested that now it works properly and uncommented it. Just trying not to spawn too many pull requests for the minimal changes.
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.
does it mean we missed something during the testing, something was supposed to work and did not?
since there will be more a-y work, I think it should be ok.
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.
Like this very much, a good cleanup.
|
|
||
| - (jobject)getJAccessible | ||
| { | ||
| - (jobject)getJAccessible { |
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.
should this K&R brace be reverted to the objectively better style used elsewhere in this file?
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 would object to objectively - i think this is subjective - but sure, i will fix that :)
| GET_MAIN_JENV; | ||
| if (env == NULL) return NULL; | ||
| jresult = (jobject)(*env)->CallLongMethod(env, self->jAccessible, jAccessibilityAttributeValue, (jlong)@"AXValue"); | ||
| jresult = (jobject)(*env)->CallLongMethod(env, [self getJAccessible], |
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.
not an expert, but do we really need to initialize jresult to NULL in line 110?
can the variable be declared in line 113 ?
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.
Well this pattern was used to initialize the result value to the default return value so if assignment does not happen due to the Java exception we have something meaningful to return but in case of NULL it is not really required because it will produce the same result anyways.
| NSSize size = [variantToID(env, jresult) sizeValue]; | ||
| id p = [self requestNodeAttribute:@"AXPosition"]; | ||
| id s = [self requestNodeAttribute:@"AXSize"]; | ||
| if (p == NULL || s == NULL) { |
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.
not a big issue, but would it be (marginally) better to bail out early if p == NULL ?
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.
But that would require two conditions - one for position and one for size - with the same logic which would look not that compact and pretty.
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.
but it will save a couple of nanoseconds!
the code is ok. one question though: what are the circumstances when these calls would return NULL?
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.
- Custom component that has no role assigned at all
- Exception happens on Java side processing the request
That was just two popped out - probably there are more scenarios.
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.
right, thank you for clarification!
|
I don't see any obvious issues in the monkey tester with the Logging -> Accessibility enabled. Here, for example, what it logs for the focusable label: |
|
@arapte Can you please take a look? |
arapte
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
|
/integrate |
|
Going to push as commit 2dd9026.
Your commit was automatically rebased without conflicts. |
|
@azuev-java Pushed as commit 2dd9026. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1840/head:pull/1840$ git checkout pull/1840Update a local copy of the PR:
$ git checkout pull/1840$ git pull https://git.openjdk.org/jfx.git pull/1840/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1840View PR using the GUI difftool:
$ git pr show -t 1840Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1840.diff
Using Webrev
Link to Webrev Comment