interop-accessibility icon indicating copy to clipboard operation
interop-accessibility copied to clipboard

Need tests for non-empty white space only alt values, and interior white space values

Open cookiecrook opened this issue 1 year ago • 5 comments

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">

cookiecrook avatar Mar 23 '24 18:03 cookiecrook

A space should be different from the empty string, right?

zcorpan avatar Mar 26 '24 09:03 zcorpan

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.

cookiecrook avatar Mar 26 '24 22:03 cookiecrook

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

cookiecrook avatar Apr 18 '24 23:04 cookiecrook

@a-savva

zcorpan avatar Jan 07 '25 17:01 zcorpan

Assigning this one to @a-savva who's working on it.

rahimabdi avatar Jan 28 '25 22:01 rahimabdi