Open dandclark opened 6 months ago
Not that it answers this question, but I wanted to note that <img alt="">
is special. It historically was a way to indicate decorative/redundant images before ARIA existed. The presence of an alt attribute with the empty string tells screen readers like JAWS to not attempt to repair the missing alt attribute. We can't really break that since it's baked into the web at this point. But whether aria-label[ledby] should override that is another question.
The test reflects the desired behavior but alt=""
is special TBH.
I have long been of the opinion that, since modern IDEs will pre-fill <img src="" alt=""/>
for you, it should be permissible/valid to also add role="none"
or role="presentation"
to an image.
I do not think the specification should change here. If anything, we could add a note that this is a special case.
The Host Language Label step E of the accname computation algorithm is unclear on whether the empty string should be used if that's what the native markup provides.
Going by a strict reading of the spec, I'd guess that an empty string should be used. However the
img with tooltip label with empty alt
subtest of accname/name/comp_tooltip.html suggests that an emptyalt
attribute should be ignored. Gecko and WebKit pass this test, while Blink fails.If that test reflects the intended behavior, should the spec be updated to something like this?
Also -- if the empty string is omitted, what about a whitespace-only string? (See https://github.com/w3c/accname/issues/233).