Closed scottaohara closed 1 year ago
cc @stevefaulkner @patrickhlauke please review
those elements are exposed as a list, then no other role can be specified on the
li
.
what about
<li role=separator>
or <li role=none>
what about
<li role=separator>
or<li role=none>
I support allowing role="none"
on <li>
. have seen this in the wild, and I don't think we should discourage it:
<ul>
<li>Bats</li>
<li class="purely-decorative" role="none"></li> <!-- this list item has no content -->
<li>Cats</li>
</ul>
I lean against allowing role="separator"
on <li>
. Disallowing role="separator"
would encourage this reasonable structure:
<ul>
<li>Bats</li>
<li><span role="separator"></span></li>
<li>Cats</li>
</ul>
Or if we want the rules to be more opinionated (in the software sense), say one of the following:
role="none"
on empty <li>
, disallow otherwiserole="none"
SHOULD NOT be on <li>
(but valid reasons may exist)that seems reasonable on its surface, but would make the implementation of the rule more complicated. practically one could do aria-hidden=true
on the li
to achieve the same effect, and not have to have additional checks to the rule to determine not only if it was empty, but if it did have children that they only equated to white space, or themselves had alt="", or aria-hidden=true or role=none/presentation, as applicable to the element and its children, if any.
re:
I lean against allowing role="separator" on
<li>
.
if that were actually allowed by ARIA/HTML, then it would be a reasonable allowance. Separately I have tested the current reality of how that works with AT, and while it causes some minor breakages depending on the browser/at combo, I have requested that become an allowance in HTML, which would then make it allowed in ARIA, and subsequently this spec. Until then though, there will be no change here on that matter.
that seems reasonable on its surface, but would make the implementation of the rule more complicated. practically one could do
aria-hidden=true
on theli
to achieve the same effect
I'm convinced. Thanks for the clear explanation.
Closes #351
This change is to clarify that if an
li
is a child of aul
,ol
, ormenu
element, and those elements are exposed as alist
, then no other role can be specified on theli
.However, if the parent of the
li
is no longer exposed as alist
, or if someone were to write invalid markup and use anli
outside of the expected list > listitem markup pattern, then any role should be allowed on theli
(so long as the role is a role allowed by theli
's parent element)For instance,
is not be allowed as a
button
cannot be a direct child of atable
. However, but arole=row
on theli
would be allowed in this example.and
is invalid HTML, but as the
li
is not a child of a list element, it should be allowed to have any role.test cases
Preview | Diff