w3c / html-aria

ARIA in HTML
https://w3c.github.io/html-aria/
Other
179 stars 48 forks source link

Consider allowing roles on <area> with no href attribute #325

Closed scottaohara closed 2 years ago

scottaohara commented 3 years ago

Creating this issue to replace #317, as there is no need to resolve that issue for 1.0 specification, but we should consider this suggestion going forward.

<a> with no href takes any role, but <area> with no href takes no roles. These are similar and seem like they should be consistent. <area role=button> seems like it would be useful, as would checkbox and other widget roles.

scottaohara commented 2 years ago

Spent quite a bit of time reviewing this today. Due to the area element's inability to be styled effectively, that it cannot contain any child elements (save for css pseudo-element content - but even that doesn't render near the actual area, but rather adjacent to the image map)... i really don't see how this would be a good change. though the concept of a and area without href are similar, the actual rendered result is quite different.

That said I can see a potential use case of allowing role=button or role=link (ideally with tabindex=0, but there can also be legitimate use cases for needing to expose these roles but not wanting them in the tab order - per other elements that perform the same functionality).

cc @stevefaulkner and @patrickhlauke, what say you two on this?

patrickhlauke commented 2 years ago

discussed at meeting today with @scottaohara and @SteveFaulkner - agreed to allow role="button" and role="link" (with tabindex="0") but not other roles due to weird browser behaviour/treatment of <area>

scottaohara commented 2 years ago

specifically due to the fact that no styling is allowed for these elements, or allow for nested content in away that would make sense for any other role here.