-
Notifications
You must be signed in to change notification settings - Fork 78
Image has accessible name fixes #1208
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
Conversation
…into image-has-accessible-name
…e <img/> inapplicable)
…mples display an image
…splay an image and has no visual rendering)
…img, but had role=img
I don't have write access to the repo, so I can't:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
## Applicability | ||
|
||
The rule applies to HTML `img` elements or any HTML element with the [semantic role][] of `img` that is [included in the accessibility tree][]. | ||
The rule applies to HTML `img` elements or any HTML element with the [semantic role][] of `img` that is [included in the accessibility tree][] and displays an image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "displays an image" need to be clarified.
For example <img src="this.url.does.not.exists" />
arguably does not display an image, but I think this is not what you intend to rule out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing:
and displays an image
to
and renders an image or an omitted image indicator
based on the rendering description here https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:attr-img-src-5
Is that description precise enough?
The definition above requires a name for a missing URL specified by HTML, but not for a missing CSS background-image (which seems right because users don't know the CSS image is missing, unless they look at DevTools console)
A couple of options that won't work:
-
Using the represents nothing definition from HTML. I don't think that works if there's a CSS background-image and no src.
-
Using the valid non-empty URL potentially surrounded by spaces definition from HTML. That doesn't work for inline SVG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this?
it's [current request][]'s [state][image request state] is not [completely available][]; or
I used it here: https://github.com/act-rules/act-rules.github.io/pull/1213/files#diff-f7f0c7b0159f5cafa41a1983a6d9389aR30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 👍 just a minor changes.
|
||
```html | ||
<img /> | ||
<img src="/test-assets/shared/w3c-logo.png" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Althought this code is considered img
element with an empty accessibile name but I guess we can improve this example by adding alt
attribute. What do you think?
<img src="/test-assets/shared/w3c-logo.png" /> | |
<img src="/test-assets/shared/w3c-logo.png" alt=""/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that would break the example, as alt=""
would make the image decorative, which we don't want for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! I do support changes proposed by @WilcoFiers here.
I'll take a look at the changes requested when time allows - probably in a couple of weeks. Other stuff taking priority at the moment due to Covid-19 |
Getting back to this - this rule has changed a lot since the original PR in March (including the rule being renamed, and some of the changes from this PR were picked up in #1300). I think it might be clearer to open a new PR and refer back to this one (for requested changes). Anyone disagree? |
Do it. It will be much easier for everybody (especially for you). |
# Conflicts: # __tests__/spelling-ignore.yml # _rules/image-accessible-name-23a2a8.md
… an image (i.e. have non-text content)
Yep, makes sense, new PR is #1382 I don't have rights to assign reviewers, so can someone do that? |
Handled in #1382, closing this PR. |
Closes issue(s):
#1124
#1125
Need for Final Call:
This will require a 2 weeks Final Call due to substantial changes affecting most test cases
This PR:
<img/>
inapplicable because it has no visual rendering, and is not voiced)role=img
torole=figure
in Inapplicable Example 1 because the example description is "The element does not have the semantic role ofimg
"img src
orbackground-image
to most examples<img/>
as an inapplicable example<img srcset='...'/>