Show a warning message for images with a "null" name value
Categories
(DevTools :: Accessibility Tools, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: mtigley, Unassigned, Mentored)
References
Details
Attachments
(1 file)
14.79 KB,
image/png
|
Details |
An image element's accessible object should always have a name descriptor for it. Usually this means ensuring the image element has an "alt" text attribute. If this value does exist, or is null, then the image is inaccessible. The highlighter's info-bar should indicate if the accessible's name value does not exist for image elements. Otherwise, simply display the name of the accessible in its info-bar highlight. The attached screenshot shows an example of what warning could be displayed for an inaccessible image. For reference: https://webaim.org/techniques/alttext/
Updated•6 years ago
|
Reporter | ||
Comment 3•5 years ago
|
||
Hi, yes it's still available!
A good place to start with is examining how the Contrast Ratio component is shown in the accessible highlighter's infobar. I believe these are the relevant places to start looking at how this is put together:
https://searchfox.org/mozilla-central/source/devtools/server/actors/accessibility/accessible.js#424
https://searchfox.org/mozilla-central/source/devtools/server/actors/highlighters/utils/accessibility.js#189
https://searchfox.org/mozilla-central/source/devtools/server/actors/highlighters/utils/accessibility.js#378
Reporter | ||
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Thanks Micah. I'm assigned to another bug now so I'll come back to this one if it's still free.
Comment 5•5 years ago
|
||
Ok I'm free to work on this one now.
I had a look at the contrast ratio code so I think I have an idea on how to work on this. Do you just want the infobar highlight to have another component that reads "No Alt Attr" for images with a null name value? And is this implemented as an additional audit step here? https://searchfox.org/mozilla-central/source/devtools/server/actors/accessibility/accessible.js#442
Reporter | ||
Comment 6•5 years ago
•
|
||
Great! I'll assign you to this issue.
Yes, much like how the Contrast Ratio audit has its own component to be rendered inside accessible infobar, we can create another component that shows "No Alt Attr" or something similar when an image has a null name value.
Ah, I apologize, I realized the first link no longer points to the correct place to add an additional audit. You're right, https://searchfox.org/mozilla-central/source/devtools/server/actors/accessibility/accessible.js#442 is the correct spot to add this new step. After this line, we can add a new audit step for getting the accessible's name value for an image.
So to summarize:
- Create a new function similar to
_getContrastRatio
that returns whether or not an image accessible has a name value. - Add this new audit function as a new step in the audit method
- Create a new AudiReport component similar to the Contrast Ratio audit report. Since this audit is rather simple, the only two class methods you need to implement are
buildMarkup
andupdate
. - Finally, add this new AuditReport component to the Audit class's reports list. Audit is responsible for updating and showing reports in the infobar highlighter.
I believe this is what we need to do to get this working. However Yura will know better on how this should be done (Yura, please let us know if I missed any steps/details).
Reporter | ||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Sounds good. Thanks for the summary, that's very helpful
Comment 8•5 years ago
|
||
Hey TomS, I noticed this bug hasn't been updated in a month. Do you need more time to work on this (which is totally fine of course)? If not, please let me know so we can make this bug available for others to pick up.
Comment 9•5 years ago
|
||
Hi if this bug is available ,can I work on this issue?
Comment 10•5 years ago
|
||
Apologies @pbro, I haven't had the time. If Monika would like to pick this up, you can assign it to her.
Updated•5 years ago
|
Reporter | ||
Comment 11•5 years ago
|
||
Hi, Monika. This bug is now being worked on in Bug 1518808, so it's not available to work on anymore. Sorry about that! You can find similar good-first-bugs for DevTools here: https://codetribute.mozilla.org/projects/devtools
I'll resolve this bug as a duplicate.
Reporter | ||
Updated•5 years ago
|
Description
•