Skip to main content

Cornell University

Web Accessibility Reviews

ARIA required context role

Applicability

This rule applies to any [HTML or SVG element][] that is [included in the accessibility tree][] and has a [WAI-ARIA 1.2][aria 1.2] [explicit semantic role][] with a [required context role][], except if the element has an [implicit semantic role][] that is identical to its [explicit semantic role][].

Expectation

Each test target is the child in the [accessibility tree][] of an element that has a [semantic role][] that is one of the [required context roles][] of the target element.

Assumptions

The rule assumes that the [explicit role][] of the applicable elements is appropriate for their element. I.e. A heading incorrectly marked up with role="cell" does not fail [success criterion 1.3.1 Info and Relationships][sc131] for not being in the context of a row. Having an inappropriate role is itself an issue under 1.3.1 Info and Relationships, so in either scenario a failure of this rule means this success criterion is not satisfied.

Accessibility Support

  • User agents do not all have the same accessibility tree. This can lead to different results for this rule, depending on which accessibility tree is used as input.
  • aria-owns has limited support in some user agents.
  • There exist some combination of popular browsers and assistive technologies who do not announce correctly relationships based on a mix of [implicit][implicit role] and [explicit][explicit role] roles.

Background

The applicability of this rule is limited to the [WAI-ARIA 1.2 Recommendation][aria 1.2] roles. The [WAI-ARIA Graphics Module][] does not include any [required context roles][]. The [Digital Publishing WAI-ARIA Module (DPUB ARIA) 1.0][dpub 1.0] only has two roles with [required context roles][] (doc-biblioentry and doc-endnote); both of them have issues with their use of role inheritance, and both of them are deprecated in the [Digital Publishing WAI-ARIA Module (DPUB ARIA) 1.1][dpub 1.1] editor's draft.

An example of an element that has an [implicit semantic role][] that is identical to its [explicit semantic role][] is a <li role="listitem"> element. These elements are not applicable because they have extra requirements and should thus be checked separately.

Being a child in the [accessibility tree][] is different from being a child in the DOM tree. Some DOM nodes have no corresponding node in the [accessibility tree][] (for example, because they are marked with role="presentation"). A child in the [accessibility tree][] can thus correspond to a descendant in the DOM tree. Additionally, the use of aria-owns attribute can change the tree structure to something which is not a subtree of the DOM tree.

This rule is restricted to direct parent-child relation in the [accessibility tree][] which is more strict than the definition of "owned element" in WAI-ARIA. This rule mimics, on the roles level, the content model of HTML.

AI Prompt