W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2008

[whatwg] ALT and equivalent representation

From: Smylers <Smylers@stripey.com>
Date: Sat, 19 Apr 2008 23:47:34 +0100
Message-ID: <20080419224734.GR20100@stripey.com>
Bill Mason writes:

> Simon Pieters wrote:
> > For instance it would be reasonable to use two images -- a filled
> > star  and an unfilled star -- to represent a rating of something:
> >
> >    <p> Rating: <img src=1> <img src=1> <img src=1> <img src=0>
> >    <img src=0> </p> 
> >
> > You'd want the text version to be:
> >
> >    Rating: 3/5
> There would probably be the argument for more literal interpretations
> such as
> Rating: (3 black stars in unicode) (2 white stars in unicode)

You could do that, and you could also use <meter> to denote 3/5.  But
that's irrelevant -- Simon's example of alt=3/5 clearly is a genuine
alternative way of representing the same information as the images do,
and authors should be free to decide that's the text representation they
wish to use.

To think about it slightly differently, obviously it would be possible
to represent a rating with a single image containing 5 stars of the
appropriate colours; the author would just need to pre-compose the
relevant images for each possible rating, in which case 3/5 could be
implemented as:

  <img src=3_5 alt=3/5>

And in that case the alt text of 3/5 is acceptable, and clearly in the
right place.

Deciding instead to achieve this as Simon suggested above (have just 2
images and to display each rating by combining 5 instances of those
images) is an implementation detail.  There are benefits to each.  HTML
5 shouldn't bless either of them as being 'preferred'.

And since with images enabled both implementations render identically it
follows that alt text appropriate in one implementation is just as
appropriate in the other.  So what Simon suggested does make sense: when
several images are combined to convey something as a whole, it should be
a valid alternative to put text conveying the whole on any one of them,
marking the rest with empty alt text.

Received on Saturday, 19 April 2008 15:47:34 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:01 UTC