WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: alt or alt=""

for

From: Jeremy Echols
Date: Sep 5, 2019 2:38AM


If any serious accessibility tool is using regexes instead of properly parsing the DOM (pretty much every language has a way to parse HTML), that tool should be dragged into the street and shot.

I suspect every tool out there that's got widespread use just parses the DOM. But if anybody is thinking of writing their own tool to do something like this, and string scanning or regexes are where you go, please don't put those tools out for others to use as part of an audit. Accessibility is tough enough to get right even with great tools.

-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of Mallory
Sent: Wednesday, September 4, 2019 11:45
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] alt or alt=""

Sounds like maybe a regex for letters a,l,t followed by a angled bracket, however such a regex would also assume the alt attribute is last. There's no rule that it must be last, so authors could easily write <img alt src="foobar.png"> and such a filter would miss it.

cheers,

On Tue, Sep 3, 2019, at 11:57 PM, glen walker wrote:
> According to html specs, alt and alt="" are exactly the same.
>
> https://urldefense.com/v3/__https://www.w3.org/TR/2012/WD-html-markup-
> 20120329/syntax.html*syntax-attr-empty__;Iw!5W9E9PnL_ac!RTGlp6dAayXLcD
> 6E66LkW8VPT4zaWWpZJLyoAPj-cPch4Pxe0-PPypGo0z-xkYXalg$
>
> "And alt> cannot be assured to identify a decorative image if some
> other attribute follows the alt attribute"
>
> I don't follow that. Why does it matter if there's another attribute
> following alt?
>
>
> On Tue, Sep 3, 2019 at 3:43 PM Peter Shikli < <EMAIL REMOVED> > wrote:
>
> > As a coder myself, it would be easier to write an if-then-else logic
> > statement to find alt="" than just alt since that latter is part of
> > many other constructs. And alt> cannot be assured to identify a
> > decorative image if some other attribute follows the alt attribute.
> > The net result is that I recommend the extra finger workout to type
> > alt="" to make sure a screen reader catches it correctly and informs the user about decorative images.
> >
> > Cheers,
> > Peter Shikli
> > Access2online
> >
> >
> > > > > > https://urldefense.com/v3/__http://list.webaim.org/__;!5W9E9PnL_ac!R
> > TGlp6dAayXLcD6E66LkW8VPT4zaWWpZJLyoAPj-cPch4Pxe0-PPypGo0z8m2iMdNA$
> > List archives at
> > https://urldefense.com/v3/__http://webaim.org/discussion/archives__;
> > !5W9E9PnL_ac!RTGlp6dAayXLcD6E66LkW8VPT4zaWWpZJLyoAPj-cPch4Pxe0-PPypG
> > o0z9id6TdoA$ > >
> > > https://urldefense.com/v3/__http://list.webaim.org/__;!5W9E9PnL_ac!RTG
> lp6dAayXLcD6E66LkW8VPT4zaWWpZJLyoAPj-cPch4Pxe0-PPypGo0z8m2iMdNA$
> List archives at
> https://urldefense.com/v3/__http://webaim.org/discussion/archives__;!5
> W9E9PnL_ac!RTGlp6dAayXLcD6E66LkW8VPT4zaWWpZJLyoAPj-cPch4Pxe0-PPypGo0z9
> id6TdoA$ >