aria-owns-valid

aria-owns must give each element one owner, and never an ancestor of the owner

automaticWCAG 1.3.1, 4.1.2 (A)confidence: highseverity: seriousrobust

Checks that no element is named by more than one aria-owns, and that no aria-owns names the element itself or one of its ancestors.

Applies to. Elements the page shows with an aria-owns naming at least one element in the same tree.

Expectation. WAI-ARIA: an element has only one owner, so its id is in no more than one aria-owns, and an element cannot own one that contains it.

  • An element named by two or more aria-owns: fail (ARIA_OWNS_DUPLICATE), reported on the element owned. The browser gives it to one owner, by order, so the structure the other owners state is lost.
  • An aria-owns naming the element itself or one of its ancestors: fail (ARIA_OWNS_ANCESTOR), reported on the owner. The browser ignores that ownership, as it would make a cycle.
  • Otherwise: pass.

What a finding reports.

  • ownerCount: for ARIA_OWNS_DUPLICATE, how many elements name the owned element in aria-owns.
  • ownedId: the id named.

These data.details fields help to read and reproduce a finding. Apart from reasonCode and the few fields Output schema names as stable, they are not a stable contract: a field may be renamed or dropped in a minor release, so don’t build on them.

Examples

pass
<ul role="list" aria-label="Steps" aria-owns="step-2"><li>Choose a size</li></ul>
<div role="listitem" id="step-2">Pay</div>

The list owns one element that no other aria-owns names.

fail
<div role="list" aria-label="Today" aria-owns="task"></div>
<div role="list" aria-label="Tomorrow" aria-owns="task"></div>
<div role="listitem" id="task">Call the bank</div>

Two lists claim the same item. The browser gives it to only one of them, so the other list's structure is lost.

View source