Skip to content
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

Should getComputedAccessibleNode() take a node, instead of an element? #185

Open
aleventhal opened this issue Nov 29, 2021 · 4 comments
Open

Comments

@aleventhal
Copy link
Collaborator

  1. An AX tree can contain accessible nodes that are backed by the document, or a text node, neither of which are elements.
  2. It's possible to reach one of these nodes via parent, firstChild, nextSibling, etc.
  3. The explainer at https://wicg.github.io/aom/explainer.html is inconsistent, containing references both to getComputedAccessibleNode(node) and getComputedAccessibleNode(Element el)

I suggest that it should be possible to pass a node to getComputedAccessibleNode().

@aleventhal
Copy link
Collaborator Author

Assuming we do this, we need a special role string for text.
I don't think it should be possible to assign an element with a role of text via role="text", but should be possible to create a virtual node with a role of "text".

@asurkov WDYT?

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 29, 2021
Fix a crash by allowing computed accessible nodes to be backed by a
Node*, rather than requiring an Element*.
See AOM issue WICG/aom#185

Bug: 792783,1274837,1245437
Change-Id: Ib5f5ff558a1a848797adc79aac43deb31fd414dd
@cookiecrook
Copy link
Collaborator

There's some baggage related to the "text" role, as previously implemented by WebKit, and then removed from the the spec drafts later. WebKit didn't remove support for the old role, but b/c of the baggage and webcompat issue, I'd prefer we avoid making an "text" role, regardless of whether it's abstract or concrete. cc @joanmarie

I also recall there was consensus to not work on the computed tree for the time being. Has that changed?

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 30, 2021
Fix a crash by allowing computed accessible nodes to be backed by a
Node*, rather than requiring an Element*.
See AOM issue WICG/aom#185

Bug: 792783,1274837,1245437
Change-Id: Ib5f5ff558a1a848797adc79aac43deb31fd414dd
@asurkov
Copy link
Member

asurkov commented Nov 30, 2021

I think either of ways is a livable thing:

  • If we expose an accessible object for non element DOM nodes, like text node or document node, then it keeps us closer to DOM concepts, which makes it natural for web developers and provides a shallow learning curve. I suppose we could use text_leaf/static_text role or so for DOM text node accessibles (something from MSAA world which used to rely on text nodes) and also make it provide rendered text.
  • On the other hand, accessibility APIs like IA2 were living just fine with no text accessibles by operating with hypertext/hyperlink concepts. Iirc NSAccessibility doesn't have accessible objects for text nodes either. So I suppose AOM could be designed that way as well. If AOM provided a text interface, then it'd be also an option. It certainly should be good for testing.

@aleventhal
Copy link
Collaborator Author

There's some baggage related to the "text" role, as previously implemented by WebKit, and then removed from the the spec drafts later. WebKit didn't remove support for the old role, but b/c of the baggage and webcompat issue, I'd prefer we avoid making an "text" role, regardless of whether it's abstract or concrete. cc @joanmarie

We could also have it have an undefined role, e.g. ax_node.role === undefined.

I also recall there was consensus to not work on the computed tree for the time being. Has that changed?

Probably not. I'm just trying to fix a crash that occurs in our current implementation, which is behind a flag. The crash occurs because nextSibling matches text nodes.

I'm not really too excited about this API unless there are consumers banging down our door for it.

If we don't want to change the IDL, I'm happy to find another solution.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Dec 6, 2021
Since one can only get a computed AX node for an element, it makes
sense sense to skip over document and text nodes.

However, an element is not required for all nodes. An example is
a pseudo element styled as display:table, which has some AX nodes
that do not have any kind of matching DOM node.

Bug: WICG/aom#185
Change-Id: Icb1f19c3c8c524593cb31e19af3d4b44f6d565b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants