Clarifications to allowed roles on li element #3439
Labels
needs discussion
More discussion is needed to continue
standards
Issues in the ARIA standards objects (lib/standards)
Milestone
ARIA in HTML is clarifying the allowed roles on
li
elements.This update disallows any role on an
li
element so long as it is a child of aul
,ol
ormenu
element is exposed as an implicit or explicit role=list. A role oflistitem
could produce a warning for unnecessary use of a redundant role.However, if the parent
ul
,ol
ormenu
has its implicit list role overwritten, then theli
may have Any role so long as that role is an allowed role of its ancestor elements.For example, the following
li
may have arole=button
specified as the parent list element as arole=none
However, as the following
ul
has arole=menu
specified, therole=button
is not allowed. The only allowed roles for theli
would bemenuitem
,menuitemcheckbox
ormenuitemradio
(ornone
/presentation
so long as within theli
there is one of the menteionedmenuitem*
roles).similar to the following, as while the
ul
has arole=none
, it is a child of arole=tablist
, so therefor theli
may only have a role that is an expected descendant of atablist
.Finally, even though the following would be flagged for invalid HTML, the
li
is again allowed any role as it is exposed as ageneric
role when not correctly nested within a list element:Additional test cases provided here.
The text was updated successfully, but these errors were encountered: