Skip to content

Add / improve mechanisms for finding owner / owned elements #3888

@WilcoFiers

Description

@WilcoFiers

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 divs 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 <p> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech debtTechnical debt related tasks

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions