Skip to content

Bug: axe-core/cli validator does not correctly handle the option to have elements with role="group" in a listbox context, as introduced in ARIA 1.2 #313

@spectranaut

Description

@spectranaut

Product: cli

Motivation:

ARIA 1.2 introduces the option to use role="group" in a listbox context, but limit's the children of the group element to elements with role option. See the specification for listbox here and for group here and for option. You can see an example in the Aria Practice Guideline listbox with group.

Replication of error:

If you run the AXE cli on the Aria Practices page you can see two incorrect errors:

axe https://w3c.github.io/aria-practices/examples/listbox/listbox-grouped.html --tags cat.aria
Running axe-core 4.3.2 in chrome-headless

Testing https://w3c.github.io/aria-practices/examples/listbox/listbox-grouped.html ... please wait, this may take a minute.

  Violation of "aria-required-children" with 1 occurrences!
    Ensures elements with an ARIA role that require child roles contain them. Correct invalid elements at:
     - #ss_elem_list
    For details, see: https://dequeuniversity.com/rules/axe/4.3/aria-required-children

  Violation of "aria-required-parent" with 11 occurrences!
    Ensures elements with an ARIA role that require parent roles are contained by them. Correct invalid elements at:
     - #ss_elem_1
     - #ss_elem_2
     - #ss_elem_3
     - #ss_elem_4
     - #ss_elem_5
     - #ss_elem_6
     - #ss_elem_7
     - #ss_elem_8
     - #ss_elem_9
     - #ss_elem_10
     - #ss_elem_11
    For details, see: https://dequeuniversity.com/rules/axe/4.3/aria-required-parent

12 Accessibility issues detected.
Testing complete of 1 pages

If you run AXE against a test file with the following html you will see the incorrect absence of an error on the group element (you instead will only see the listbox error about required children, like above):

<div role="listbox" aria-label="foo">
  <div role="group" id="listbox-group-1">
    <div></div>
  </div>
</div>

Expectation:

There are three errors with the AXE cli here:

  1. The first error on the APG page Violation of "aria-required-children" with 1 occurrences! should not occur, because it is erroring on the group as a descendant of a listbox, which is allowed as of ARIA 1.2
  2. The first error on the APG page Violation of "aria-required-parent" with 11 occurrences!! should not occur, because it is erroring on the option element not being a direct descendant of a listbox element, which is now allowed as of ARIA 1.2, so long as it is a direct descendant of a group element.
  3. The final error is the lack of reporting an "aria-required-children" on the element with a group role.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions