-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: Add basic text support on Unix #362
Conversation
About the text insertion and removal events, will it help if we refactor Orca doesn't actually call any of the methods on the |
No, Chromium doesn't even have a stub implementation, and I couldn't find any Chromium specific workaround for this in particular inside Orca.
This would allow us to implement the same algorithm as Chromium, only building the entire text content for nodes where it is necessary. It should be noted though that there is this comment in said algorithm:
Which I think asks for more text events to be emitted by the renderer process. So the proper way to solve this would probably be #6. |
In the new methods for converting to and from global character indices, we shouldn't use |
I suggest adding a stub implementation of |
I suggest adding a new internal helper function to |
Actually, I was wrong about the conversion between AT-SPI offsets and AccessKit text positions/ranges. AT-SPI offsets, including the Note, though, that the AT-SPI "character" granularity does cover a whole character as defined by AccessKit, not necessarily a single Unicode scalar value (code point). So calling Finally, you may notice that the |
That's all of my feedback on this PR for now. We still need to implement insert and delete events, one way or another. The switch to immutable-chunkmap is blocked for now, because I haven't gotten any response to my PRs on that project. As for more precise events, I'm reluctant to add them as I mentioned before, but I will if they're required for full accessibility on Wayland. I wrote a comment on an at-spi2-core issue about this. |
Oh yes, I messed up here...
I was looking for more descriptive names, I'll rename these functions. Thanks! |
@DataTriny What do you think about my earlier suggestion that we might not need to implement the AT-SPI |
@mwcampbell Thanks for the reminder. I had filed this issue on the |
You can help test this feature by running egui-based programs using my unix-text-testing branch. |
I don't think we actually want to check |
5ab8958
to
0776bcf
Compare
To be exhaustive, I should mention the existence of the |
If no one else emits that signal and Orca doesn't use it, I think we can safely ignore it. |
I'm marking this as ready for review, but I'll have to rebase it on main before you merge it. |
In |
Currently, Also, a pattern that I'm using in GTK, that I think will become common in more advanced text implementations, is to put |
Have you tested the text change code with non-ASCII text? I see that |
In |
In |
I've finished reviewing this PR. |
@mwcampbell Thanks for the review. I knew text-changed events weren't able to handle multi-byte characters but I forgot to actually fix the algorithm. Now this is done and tested. I think it is reasonably well optimized. |
Unless I'm missing something, I think it's a mistake to increment |
The name of the variable probably didn't help the understanding. Really it's the number of unicode scalar values that both strings have in common, hence the start index of the diff. |
Yes, the new variable name is clearer. These changes look good, and I have no further suggestions. Please rebase and merge. |
…ted methods on it
…, consider generic containers
Things worth noting:
org.a11y.atspi.EditableText
interface but Chromium does not implement it apparently and it mostly send action requests we don't support anyway.GetBoundedRanges
is missing, Chromium does not implement this function either.scroll_type
argument ofScrollSubstringTo
is ignored: ourActionRequest
struct does not embed enough information to make use of it. We could compute a point and scroll to it but that may be too much responsibility.text-bounds-changed
signal is never emitted: noone seem to implement it and Orca doesn't listen to it.