dequelabs / dequelabs/axe-core
Add / improve mechanisms for finding owner / owned elements
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 29
Description
Several places in axe-core we have code to find either the owner of a node, or the owned elements. This includes the aria-required-parent / aria-required-children rules, the `aria.isComboboxPopup` method, it's used in creating accessible text, and probably other places I can't think of.
Axe-core currently has the `aria.getOwnedVirtual`. There are several TODO's in that, showing where it breaks down. There is no `aria.getOwner` to get the reverse relationship. Having these would be very useful, and would allow us to handle oddities of building the accessibility tree more consistently.
For example to properly handle how regular `div`s get skipped as "owners", but when they are focusable, have global ARIA attributes they don't. There are also things without ARIA roles that never get ignored, like `
` elements. That axe doesn't take those things into account is a potential source of (rare) false positives.
A thing to consider as we're doing this work is that it might be useful to cache ID references in axe somehow. ID lookup isn't fast, and reverse ID lookups is can be very slow. If we had some methods that would keep track of IDs and ID references, we could speed up axe-core a fair bit.
Contributor guide
Assessment
This issue has not been assessed yet.