In the Clarify that a whitespace-only alt attribute should be considered as the empty string PR, we clarified that alt=" " should be treated the same as alt="".
The WPT test linked in in that PR confirms that the accessible name is handled consistently, but we currently do not have a test covering the computed role. In practice, implementations are inconsistent when handling images with whitespace-only alt values.
Below are the results from a WPT test I created locally:
- Safari: Action get_computed_role completed with result none (consistent)
- Chrome: Action get_computed_role completed with result image (inconsistent)
- Firefox: Action get_computed_role completed with result image (inconsistent)
I believe this update should also have prompted implementors to verify role computation behavior.
@cookiecrook, if there are no objections, I can take care of creating a WPT issue in Accessibility Interop and submitting a PR to add my local test to html-aam/roles.html (or should I create a tentative because of inconsistencies)?
Note: @scottaohara, do you think we should also clarify in ARIA in HTML that:
If the img has an empty alt (alt="") and lacks any other img naming methods:
role=none, role=presentation
also applies when the alt value contains only whitespace characters?
In the Clarify that a whitespace-only alt attribute should be considered as the empty string PR, we clarified that alt=" " should be treated the same as alt="".
The WPT test linked in in that PR confirms that the accessible name is handled consistently, but we currently do not have a test covering the computed role. In practice, implementations are inconsistent when handling images with whitespace-only alt values.
Below are the results from a WPT test I created locally:
I believe this update should also have prompted implementors to verify role computation behavior.
@cookiecrook, if there are no objections, I can take care of creating a WPT issue in Accessibility Interop and submitting a PR to add my local test to html-aam/roles.html (or should I create a tentative because of inconsistencies)?
Note: @scottaohara, do you think we should also clarify in ARIA in HTML that:
also applies when the alt value contains only whitespace characters?