You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the advancements in IDEs, many elements have TAB completion. So I can type img in my file, and press TAB, and end up with <img src="" alt="" />
This is very convenient! But what it does is take away what was previously the sole indicator of author intent- the presence of an alt attribute and whether there was a value or not. With the alt attribute being added automatically, it is still very easy for an author to ignore putting a value in the code for the attribute.
The way I have done this in some code checkers is to check for the combination of an empty alt attribute and the role="none" (or presentation). If only the alt attribute is there, I throw an error, which is used to get the developers attention.
However, this approach fails current validation checkers.
Proposal
As such, I propose that we should allow three ways to indicate that an image is purely decorative:
Clarify and consolidate img ARIA allowances
This PR closes#424 and #452
* clarify when img role is allowed
* add meter to allowed role for img
* similar to progressbar, meter should thus also be allowed.
* fix img lacking alt allowance
* update changelog
Right now, this is the way that an author crafts a conformant image element that is purely presentational:
I don't want to change this, but I want to propose that we add an additional invocation that does not fail conformance checkers:
Why
With the advancements in IDEs, many elements have TAB completion. So I can type
img
in my file, and press TAB, and end up with<img src="" alt="" />
This is very convenient! But what it does is take away what was previously the sole indicator of author intent- the presence of an
alt
attribute and whether there was a value or not. With thealt
attribute being added automatically, it is still very easy for an author to ignore putting a value in the code for the attribute.The way I have done this in some code checkers is to check for the combination of an empty
alt
attribute and therole="none"
(orpresentation
). If only thealt
attribute is there, I throw an error, which is used to get the developers attention.However, this approach fails current validation checkers.
Proposal
As such, I propose that we should allow three ways to indicate that an image is purely decorative:
This would support the lovely advancements in convenience that IDEs have made while also still providing a good way for validators to ensure intent.
The text was updated successfully, but these errors were encountered: