Need tests for non-empty white space only alt values, and interior white space values
We have some image alt tests in this file: https://github.com/web-platform-tests/wpt/blob/master/accname/name/comp_host_language_label.html
But I don’t recall testing the logic for generic/none role due to empty alt text (it may be in HTML-AAM) and I’m fairly certain we don’t have tests for non-empty white space variants like alt=" " and other values like TAB, CRLF, etc, which come out of CMS templates sometimes.
Also interior non-space white space should be normalized too.
<img src="…" alt="foo
bar" data-expectedlabel="foo bar">
A space should be different from the empty string, right?
Correct, though there may be a sufficient requirement in the spec to trim a non-empty whitespace string down to the same equivalent empty string. In any case, I'd expect whitespace-only alt text to be an author error. Proposed tests are primarily to ensure all engines are doing the same thing with the author error.
For img alt, HTML differentiates the empty string from any other value -- only the empty string is special. https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element%3Athe-img-element-11
Originally posted by @zcorpan in https://github.com/web-platform-tests/interop-accessibility/issues/115#issuecomment-2039210502
@a-savva
Assigning this one to @a-savva who's working on it.