axe-core icon indicating copy to clipboard operation
axe-core copied to clipboard

aria-required-children: be less permissive of divs as child nodes

Open WilcoFiers opened this issue 3 years ago • 1 comments

ARIA required context role, failed example 3

In the ARIA required context role ACT rules, failed example 3 currently isn't being failed by axe-core. Specifically, I think aria-required-children should have caught this:

<div role="list">
  <div aria-live="polite">
    <div role="listitem">List item 1</div>
    <div role="listitem">List item 2</div>
  </div>
</div>

Because of its global attribute, that div[aria-live] should not be ignored in the accessibility tree. How browsers do this varies. Firefox considers this a section inside a list.

WilcoFiers avatar May 18 '22 12:05 WilcoFiers

Should fail due to #3468, just need to add to the getOwnedRoles function to check for tabindex > -1 or is focusable (should we make this it's own function called includedInAccessibilityTree? We do this type of check often enough it might make sense). Adding null to the list or return roles should be sufficient in this case to trigger the error message.

straker avatar Aug 10 '22 16:08 straker

Validated with the latest develop branch code base, aria-required-children failing now for the child elements which are unlisted

image

and with 4.3.5 we are reproducing the issue

padmavemulapati avatar Aug 29 '22 16:08 padmavemulapati