Closed scottaohara closed 3 years ago
circling back on this @rianrietveld , still interested in your thoughts on this issue. thanks.
@scottaohara I noticed the validator issue when I was writing text for a course about ARIA. I explain that an element can have a role and that you can remove that role using role=presentation. Taking an img as example.
In the code example I only used <img src="url" role="presentation">
without the alt
attribute, and that triggered the error.
I don’t know of any use case. For my work I always use and advice img
with an empty alt
attribute to remove it from the accessibility tree. No need to change a role if you don't have to.
The only use case for using role=presentation
IMHO would be on a table, to fix table layout with legacy code code.
Or maybe when you build complex custom widgets, something I very much stay away from.
But what I do think: it’s maybe contradictory (saying this as a non expert on writing specifications):
Why should that alt
attribute be present when you decide to remove the role.
It’s one or the other says my gut feeling.
But for your question: do you know of a use case for both alt=""
and role="presentation"
, no, I don’t.
Thank you for the response @rianrietveld
@scottaohara :-) Always
per this html validator issue it got me wondering what use cases exist for declaring an image as presentational with
alt=""
but also needing to use an ariarole=none / presentation
.As standard guidance is that authors should not need to use a role that is duplicative to the way in which the element is exposed, is this allowance needed? Is this to mitigate against a browser / AT bug? And if so, should that not be what's fixed instead of having a workaround?
@rianrietveld if you have a use case as to why both
alt=""
androle=presentation
were used in your example in the validator thread, I'd be interested to hear it.