Dieser Inhalt ist derzeit nur auf Englisch verfügbar
Audit aria-required-parent
Ensure elements with an ARIA role that require parent roles are contained by them
Impact:
Critical
WCAG-Konformität:
A
WCAG 1.3.1
Issue type:
failure
ARIA required context role
This rule checks that an element with an explicit semantic role exists inside its required context.
Content loading...
Autoren: Brian Bors, Jean-Yves Moyen, Wilco Fiers
Vorherige Autoren: Anne Thyme Nørregaard
Finanzierung: WAI-Tools
Applicability
This rule applies to any HTML or SVG element that is included in the accessibility tree and has a WAI-ARIA 1.2explicit semantic role with a required context role, except if the element has an implicit semantic role that is identical to its explicit semantic role.
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.
Some user agents try to correct missing required context roles or incorrect content model. This often results, for example, in an isolated list item being presented as part of a one-item list containing only itself. Therefore, most test cases contain several targets to try and circumvent these corrections in order to better demonstrate the issue.
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 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 and explicit roles.
These elements with an explicit role of listitem are children in the accessibility tree of an element with their required context role, list, expressed as an explicit role.
These elements with an explicit role of listitem are children in the accessibility tree of an element with their required context role even though they are not its children in DOM. The presentational node is not included in the accessibility tree.
These elements with an explicit role of listitem are children in the accessibility tree of an element with their required context role even though they are not its DOM descendants. The aria-owns attribute is used to alter the accessibility tree and place the target elements in their required context role.
These elements with an explicit role of listitem are children in the accessibility tree of an element with their required context role even though they are not its DOM children. The aria-owns attribute is used to alter the accessibility tree and place the target elements in their required context role.
These elements with an explicit role of listitem are not children in the accessibility tree of an element with their required context role, but of an element with the tabpanel role.
These elements with an explicit role of listitem are not children in the accessibility tree of an element with their required context role. They are instead children in the accessibility tree of the div with an aria-live attribute; even though this div has no role, it has a global ARIA attribute and is thus included in the accessibility tree.
These elements with an explicit role of listitem are not children in the accessibility tree of an element with their required context role because explicit parent-child relation in the accessibility tree (set by aria-owns) does not cross shadow boundaries.
<sectionrole="doc-abstract"aria-label="Abstract"><p>Accessibility of web content requires semantic information about widgets, structures, and behaviors …</p></section>
Inapplicable Example 4
There is no element whose role has required context role because the heading role does not have one.
<divrole="heading"aria-level="1">Hello!</div><p>Welcome to my homepage!</p>
Inapplicable Example 5
There is no element with an explicit role different from its implicit role. This li element has an explicit role of listitem which is identical to its implicit role.