Re: Proposal for <canvas src> to allow images with structured fallback by Tab Atkins Jr.

Steve Faulkner, Mon, 7 Mar 2011 13:40:15 +0000:
> <canvas src="complex-chart.png">
> >   <table>
> >     -data that the chart represents-
> >   </table>
> > </canvas>
>Versus this:  <img longdesc=URL src=img >  ?

I like the above idea. I even think its better than the @long desc
example Leif then cites. This is because:

1) When a some legacy UA cannot parse the <canvas> element directly it
will (I guess) access the next node which is the table element. If this
table is accessible, with a suitable caption/@summary when necessary,
and correctly marked up content, the screen reader will be able to give
this is data to the user.  So everyones happy.

2) I would prefer to see the former example rather than the latter. A
@longdesc may be suitable in some situations, in particular providing a
verbose description for some image  but accessible table markup would
trump it in the this case IMO. Of course

<canvas src="complex-charr.png" aria-describedby="somefragid">
<table>
-data that the chart represents-
</table>
</canvas>

would be even better. As a UA that can support the canvas could render
it, the aria-describedby attribute can reference some in page
description and the fallback content can be parse by legacy UAs.

Cheers

Josh

Received on Tuesday, 8 March 2011 09:15:11 UTC