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.

Indeed.

> 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.

[snip]

> 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=''.

[snip]

> 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
button."

http://dev.w3.org/html5/spec/the-img-element.html#a-link-or-button-containing-nothing-but-the-image

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:17:46 GMT