W3C home > Mailing lists > Public > public-html@w3.org > February 2012

Re: Request to Reconsider Alt Guidance Location

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Sun, 26 Feb 2012 19:45:45 +0000
Message-ID: <CAEhSh3edkSOBY7ZY93BrasqgfJZKTaFHJRNLNLX+bx5LAg+tMg@mail.gmail.com>
To: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Cc: Steve Faulkner <faulkner.steve@gmail.com>, HTML Accessibility Task Force <public-html-a11y@w3.org>, public-html@w3.org, Judy Brewer <jbrewer@w3.org>, Janina Sajka <janina@rednote.net>
On Sun, Feb 26, 2012 at 6:51 PM, Leif Halvard Silli
<xn--mlform-iua@xn--mlform-iua.no> wrote:
> So the CP should probably explain why this change would be better.


> On the other side: The current HTML5-conformance validation — like the
> HTML4 validation — has a 'loop hole subset': Presence of an empty alt
> attribute, will always make the img validate - regardless of generator
> string or other gotchas.


> So, while an HTML5 validator will display an
> error for
>         <a href=foo ><img src=bar ></a>
>   it will not display an error for
>         <a href=foo ><img src=bar alt='' ></a>
> Thus, the simple route to validity, for lazy authors and authoring
> tools, remains to include an empty alt=''.


> But then
> again, it could perhaps also be possible to plug this hole in the HTML5
> validation - e.g. by making the latter example an error.

It already is.

The HTML5 spec currently says:

"When an a element that creates a hyperlink, or a button element, has
no textual content but contains one or more images, the alt attributes
must contain text that together convey the purpose of the link or


A conformance checker can't easily verify provided non-whitespace
text, but it's trivial to detect empty or whitespace @alt values and
raise an error in this case.

Benjamin Hawkes-Lewis
Received on Sunday, 26 February 2012 19:46:54 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:48 UTC