[whatwg] image captions

Le 28 juin 2006 ? 16:01, Ben Meadowcroft a ?crit :

> Perhaps a better method would be using the longdesc attribute to  
> associate a
> caption with an image.
> Specifically we could point the image to fragment within the  
> current page
> and give an explicit association in this manner.
>
> <img src="man.gif" alt="A Man" longdesc="#manCaption" />
> <p id="manCaption">A more full description of the image</p>
>
> Does anyone know how screenreaders and other assistive technologies  
> handle
> longdesc URIs pointing to fragments within the same page?

Interesting idea, but longdesc cannot be used with <object>, <embed>  
or embedded XML (SVG for instance). Moreover, a caption isn't always  
a description.

Also, if the caption isn't identified as a caption by some mean (say  
with a "caption" class), styling is not easy and the "caption  
paragraph" can be confounded with another paragraph else. The common  
practice of having the illustration and its caption together, either  
floating on the side, indented, or spaning into the margin cannot be  
easily realised without additional, non-standard markup. People would  
then come again with different markups to solve the same problem of  
displaying a captioned image on screen, and we wouldn't have achieved  
much.

The idea I proposed earlier (May 3):

     <figure>
       <caption>Figure 1: Some image</caption>
       <img src="...">
     </figure>

makes it easy to style figures correctly, it can markup an image as a  
being a figure without the need of having a caption, and can accept  
anything as an illustration (<img>, <object>, SVG, MathML), even HTML  
(for sample code[1], tables used as figures, ordered and unordered  
lists of images, or text samples).

<figure> has the semantics of being an illustration of what is  
expressed in the surrounding prose, as opposed to <img> alone which  
can be seen as an image replacement for the "content" of its "alt"  
attribute at the place it is inserted. The <figure> caption is  
coherent with the way captions are inserted inside <table>. It also  
makes impossible to detach the caption in the markup by placing it at  
the other end of the document, something you could do with an idref  
and which may be a good or bad thing depending what we want to achieve.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/

Received on Wednesday, 28 June 2006 14:33:09 UTC