WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Regarding images lacking alts

for

From: JP Isaac
Date: Dec 10, 2012 1:31PM


I think the crux of this argument is whether an unlabelled image should be
ignored or the url announced to alert the user to a graphic that may be
important but has not been specified either way.

There's no absolute here. As a person who uses a screen reader, there have
been times when hearing the url of an unlabelled image has helped me to gain
perspective on a workflow issue in a webpage or application. Other times,
hearing urls can be annoying especially when the unlabelled images are just
layout related.

It's a commendable goal to create a scalable accessibility solution, but
there are so many gray areas that defy a single answer.

Best,

== J
-----Original Message-----
From: Bryan Garaventa
Sent: Saturday, December 08, 2012 2:58 AM
To: WebAIM Discussion List
Subject: Re: [WebAIM] Regarding images lacking alts

True, that is the purpose of the first script. It would be nice if FS
programmed JAWS to ignore images without alts, but even if they did at some
point, all prior versions would have the same problem.

I've been giving this some thought, and I know that others here have said
that they don't see the point in this script, and that they don't see that
it fixes anything. It does however make images more uniformly configured for
accessibility however.

I'll show you an example of what I mean.

Here are various image configurations, which you can paste into an html
file.

<img src="img1.jpg" />

<img title="Test2" src="img2.jpg" />

<img alt="Test3" src="img3.jpg" />

<img alt="" src="img4.jpg" />

<a href="url">
<img src="img5.jpg" />
</a>

Now, run the following jQuery script to configure the images accessibly.

// Loop through all images
$('img').each(function(i, o){
var hasAlt = o.getAttributeNode('alt') ? true : false,
hasTitle = o.getAttributeNode('title') ? true : false;
// If no alt, copy the title if present, otherwise set to null (for IE)
if (!hasAlt) $(o).attr('alt', hasTitle ? o.title : '');
// If no title, copy the alt (for FF Chrome and Safari)
if (!hasTitle) $(o).attr('title', o.alt);
});

I've tested this in IE, FF, and Chrome using both JAWS and NVDA, and have
found no negative effects, and the feedback was improved in JAWS.

So the argument earlier was, just run the page against an HTML validator and
program the images correctly the first time. This is true when editing a
particular page.

Now imagine this instead, if you were to paste this code into the global
script for Facebook, it would correct the images on over one billion pages,
instantly.

The same is true for Amazon, Wordpress, Microsoft, Target, CNN, Google, and
so on.

Does this make more sense now?


----- Original Message -----
From: "David Ashleydale" < <EMAIL REMOVED> >
To: "WebAIM Discussion List" < <EMAIL REMOVED> >
Sent: Thursday, December 06, 2012 9:33 AM
Subject: Re: [WebAIM] Regarding images lacking alts


> Correct me if I'm wrong, but I thought one of the purposes of the first
> script that Bryan wrote in this thread was to make the experience of
> encountering images with no alt attribute better by at least assigning an
> empty alt. I've noticed that JAWS tries to be "helpful" by reading the
> source path out loud when there's no alt attribute. So I see this script
> as
> something that could be included in a browser extension like Readability
> to
> make the encountering of images with no alt less annoying.
>
> However, now that I think of it, perhaps Freedom Scientific should change
> the way that JAWS reads these. Wouldn't it be better if it treated no alt
> the same way as it treats alt=""? I realize that it's trying to be
> helpful,
> but it's so often not.
>
> David
> > >