Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update allowances for image with empty alt #243

Merged
merged 5 commits into from Nov 25, 2020
Merged

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented Sep 29, 2020

commit to remove allowance for role=presentation and role=none on an <img src=... alt="">. Declaring these roles should be considered redundant/unnecessary per the alt="".

If there are situations where an image with alt="" is not being set to decorative, (thinking an img with a .svg source in webkit) then authors can still use aria-hidden=true to force the element to be hidden to the a11y tree (and would have needed to use that anyway).

closes #229


Preview | Diff

remove allowance for `role=presentation` and `role=none` on an `<img alt="">`.
@carmacleod
Copy link
Contributor

Question: Did you want to allow <img src="url" role="presentation"> for "img without alt attribute"?
(i.e. the example given in #229)

If so, might want to change the first sentence under "img without alt attribute" from:

If no author-defined accessible name is provided by other methods: No role, and no aria-* attributes except aria-hidden.

to something like:

If no author-defined accessible name is provided by other methods: Roles: none or presentation. No aria-* attributes except aria-hidden.

@scottaohara
Copy link
Member Author

@carmacleod no. Then that could result in instances of the file name of the image being announced without the image role.

If an author can add role=presentation to their <img> then it stands to reason they can add the shorter alt="" attribute and meet HTML's requirements to add an alt.

@scottaohara scottaohara merged commit 0031865 into gh-pages Nov 25, 2020
@scottaohara scottaohara deleted the update-img-no-alt branch November 25, 2020 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use case for role=presentation/none and empty alt on an image
2 participants