Wooshy.docs
Wooshy.docs copied to clipboard
Firefox (Zotero) elements inaccessible with role="tree" and other attributes
I was troubleshooting Zotero Wooshy issues as part of https://github.com/zotero/zotero/issues/2734 and discovered that they also occur in Firefox (on which Zotero is based). Reproduction page: https://gist.github.com/adomasven/502ef85597cb788e21cb0114399380f8
If you open it in Chrome you will see that every part of the HTML tree structure is fully accessible via Wooshy, yet with Firefox it is not. If you examine the page with respective Chrome and Firefox accessibility tools, you see that an accessibility tree is built for both of these.
The issue is solved by either removing the role attribute on the parent element, or changing it to the closest working role - role="list" (changing the corresponding children to expected role for list to role="row" is not necessary).
Moreover, role="grid" is broken in the same way, and perhaps there are more roles that don't work beyond that.
There may be additional issues with Zotero since it mixes XUL and HTML in its UI and is based on Firefox 60. I tested this with Firefox 89 (which I randomly had on my machine having not updated in a while), and Firefox 103 and it's broken on both versions. Firefox 60 unfortunately doesn't seem to want to display this HTML file for me.
thank you!
anything i can do on my side? i do filter out some elements depending on the AX tree, but as far as i'm aware this shouldn't be related to the FF issues. i'm having a pretty hard time with FF with both my apps tbh. they don't seem to handle the macOS Accessibility very well. i'm having also completely wrong positions sent back by FF on multiple monitors setups. (haven't reported yet, it's in my list of things to do, but i need to reimplement a few things on my side first.)
thanks for the help! and that'd be perfect if Zotero gets more accessible in the process, definitely.
I don't really know how Wooshy works aside from that I assume it's getting some accessibility tree from the app via OS APIs? Seems like Firefox builds an accessibility tree for divs with role=tree|grid|treegrid, but it is ignored by Wooshy. Based on the div role the accessibility node names in Firefox are different and I guess you're doing some sort of filtering for those? I think this could be fixed by relaxing that filter for the corresponding accessibility nodes. Is there any reason to filter those nodes out now?
basically Wooshy gets the root parent and goes down through each descendant. this is done through the AX APIs available in macOS yes. the filtering shouldn't affect though. i filter out elements that are out of the visible canvas, and other stuff that are not clickable. anyways, i've removed the filters and i still can't grab anything from Firefox. from the other tools that do something similar, only one is getting something from Firefox. so there's something that should be doable from my side. will investigate. thanks for the html file, very useful!
so the issue is that Firefox returns a noValue to an AX API call asking for the number of visible rows of the AXOutline. all the other browsers return the proper success to the API call and fill the data with the rows. but Firefox doesn't.
by tweaking the engines i can grab them, but
i'll have to check carefully that it doesn't slow down other apps that are dealing with AXOutline:
https://user-images.githubusercontent.com/121373/184503857-f2313d1e-00b8-4887-9cb4-a1f4e27582de.mp4
@adomasven a16 solves an issue with Firefox: https://github.com/godbout/Wooshy.docs/releases/tag/1.a16
any way i can test this with Zotero? sorry, i tried to use it a bit before but got lost 😅️ is there an easy way maybe to enter a feed and get data imported? thanks.
@adomasven so Wooshy should handle Firefox now, but it seems it's still not working well with Zotero: https://github.com/godbout/Wooshy.docs/issues/25