-
Notifications
You must be signed in to change notification settings - Fork 801
Feature: Accessibility Tree printing #55
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
Feature: Accessibility Tree printing #55
Conversation
|
I cleaned it up a bit, and I'm starting to like python. I moved some functions into helpers, as I think they're nice and re-usable, but whatever you want organization wise works for me. |
…t 'key', to allow for some slightly more complex behaviors.
|
@KingOfBrian Argh, kind of forgot about this. I'll try to look at it soon. I'm no expert on accessibility so I kind of procrastinated 😞. Feel free to ping. |
|
No problem! The basic interplay with accessibility, is that if accessibilityElementCount != NSNotFound, traverse the accessibility tree, otherwise, traverse the subviews. This is the same method that voice over uses. It then print out every element, if isAccessibilityElement = YES, print the accessibilityLabel/Value, otherwise print out a no-op string. If there's any other info you want, just ask! |
commands/FBPrintCommands.py
Outdated
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.
There's a triple-space between the sentences, not sure if intended. One is the norm in Chisel.
|
For anyone else looking, here's a compare view to see relevant changes in this diff: facebook:master...KingOfBrian:feature/KingOfBrian/AccessibiltyTree
As for the number of commands evaluated to get the output, one of the things Chisel does elsewhere is call private methods which generate similar output, and from there Chisel scrapes the output. Perhaps there's a private method that could be used to do some of the work that's being done in this PR. You could look at these headers for any leads: https://github.com/nst/iOS-Runtime-Headers. Turns out there's dozens if not hundreds of accessibility related methods in Along these lines, I've had the thought that Chisel could benefit from having a library of its own that would be dynamically loaded into the app so that the code we want evaluated is run more directly. |
Conflicts: commands/FBPrintCommands.py fblldbobjecthelpers.py fblldbviewhelpers.py
…orm the user that accessibility needs to be enabled.
|
Hey @kastiglione , I did a number of updates to address most of your issues (I think). I'm a bit nervous about the integer fix, but I believe it's correct. I searched the private headers and wasn't able to find one. That would of been nice! |
|
@KingOfBrian Is this pull request superseded by #70? Or is there functionality here that's missing in #70? |
|
Closing since I understand this to be superseded by #70. @KingOfBrian if this is incorrect, feel free to re-open. Thanks so much for your time, effort and contribution! 💎 |
|
Yea, no worries, glad we got something better in. I may add some thing to print out more information when I have some ax work, but thanks for following up. |
This is not quite ready, and full of terrible python, but the basics are there. It's sort of comical how long it takes to run and the amount of commands sent to generate the output. But I think it will be helpful with some tuning. Any suggestions would be good to get.
It adds a pae command that prints out the accessibility tree starting from the current object. If the current object is a UIView, it will also traverse subviews to find accessibility elements, as I think that's what voice over is doing.