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

Image has a long description attribute #108

Closed
alvaromontoro opened this issue Mar 22, 2021 · 7 comments · Fixed by #152
Closed

Image has a long description attribute #108

alvaromontoro opened this issue Mar 22, 2021 · 7 comments · Fixed by #152
Assignees
Labels
a11y feature New feature or request for an a11y check good first issue Good for newcomers

Comments

@alvaromontoro
Copy link
Contributor

Describe the new a11y feature or project enhancement

The longdesc attribute in images is deprecated and should not be used. It is not fully supported by HTML5, browsers, or screen readers. When present, it is commonly misused (it should point to an URL that is not an image).

Describe the solution you'd like

Show a warning if:

  • an image has the longdesc attribute. Recommend the removal of the attribute and adding the information on the same page (e.g. with an aria-describedby)

Show an error if:

  • The value of longdesc is not a URL (this may be tricky as it could be a relative path).
  • The value of longdesc contains spaces (then it would be text and not a URL)
  • The value of londgesc is a link to an image. This could be tested via CSS by checking if the end of the value is an image extension (e.g. ".jpg", ".jpeg", ".png", ".gif", etc.)
  • The value of longdesc is empty.

Testing the first two points may be tricky and lead to false positives (e.g. a URL that has not been encoded and contains white space). Because of that, maybe those two cases should be ignored.

Link(s)

@jackdomleo7
Copy link
Owner

This is a brilliant idea and a nice feature to add to a future version 👌

@jackdomleo7 jackdomleo7 added the a11y feature New feature or request for an a11y check label Mar 22, 2021
@jackdomleo7 jackdomleo7 added the good first issue Good for newcomers label Oct 1, 2021
@Deep1Shikha
Copy link

@jackdomleo7 , I would like to pick this issue. Please assign it to me.

@jackdomleo7
Copy link
Owner

@Deep1Shikha absolutely 🙂

@jackdomleo7
Copy link
Owner

Accidentally clicked the close button - for auditing

@alvaromontoro
Copy link
Contributor Author

@Deep1Shikha are you still working on this one? If not, maybe I can pick it up :)

@jackdomleo7
Copy link
Owner

Doesn't look like @Deep1Shikha has made any progress yet (https://github.com/Deep1Shikha/Checka11y.css). Maybe we could give them a week to respond and if not, I can assign to @alvaromontoro?

@alvaromontoro
Copy link
Contributor Author

@jackdomleo7 assign it to me. I will work on it this week(end).

alvaromontoro added a commit to alvaromontoro/Checka11y.css that referenced this issue Dec 9, 2021
…leo7#151)

These changes address jackdomleo7#108 and jackdomleo7#151. Summary of changes:

- Add warning when longdesc is present
- Add error when longdesc has some invalid values (empty, containing white spaces, or image urls)
- Add examples to the demo page
- Add tests for the new warnings and errors
- Update the list of codes
- Build the library
- Switch the order of warnings and errors (jackdomleo7#151)
@jackdomleo7 jackdomleo7 linked a pull request Dec 11, 2021 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y feature New feature or request for an a11y check good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants