W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] Fallback for <picture>

From: Mathew Marquis <mat@matmarquis.com>
Date: Sun, 13 May 2012 17:53:45 -0400
Message-Id: <537F679B-0336-4F7E-8D96-80F1D44EAA1A@matmarquis.com>
To: Kornel Lesiński <kornel@geekhood.net>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>
On May 13, 2012, at 4:20 PM, Kornel Lesiński <kornel@geekhood.net> wrote:

> 
> Syntax used on the wiki:
> http://wiki.whatwg.org/wiki/Adaptive_images
> 
> places alt on the new element:
> 
> <picture alt="alt">
>    <source …>
>    <img>
> </picture>
> 
> 
> I think it can be improved in two ways:
> 
> - Instead of having alt on <picture>, it could be on the fallback <img>. This will give better backward-compatibility.

Seems perfectly reasonable to me. I assumed an alt tag on both picture and the fallback, but this could serve to both cut down on redundancy for authors _and_ encourage authoring that’s equally accessible whether or not `picture` is supported.

> 
> - Use of an attribute for alternative content is very limiting, e.g. image of a comic cannot have dialog marked up well. Use of an non-empty element opens up possibility of richer alternatives.

I whole-heatedly agree. The primary objective is accessibility, for certain, but being able to serve tabular data as the fallback for a complex infographic stands to benefit _everyone_. I’d love to explore this further.

> 
> 
> The processing rules for extracting fallback from <picture> would be:
> 
> 1. Take all children of <picture>
> 2. Remove/ignore all <source> elements.
> 3. Interpret all <img alt=""> elements as their alt text.
> 
> 
> <picture>
>    <source …>
>    <img alt="This is unstructured fallback">
> </picture>
> 
> and
> 
> <picture>
>    <source …>
>    <img>
>    This is <em>structured</em> fallback
> </picture>
> 
> The two examples above would have "This is unstructured fallback" and "This is <em>structured</em> fallback" as their alt, respectively.
> 
> 
> A use case for markup in alt:
> 
> <picture>
>    <source src="world-map-showing-most-popular-browser-in-each-country.png">
>    <table><tr><th>Country</th><th>Most popular browser</th>...
> </picture>
> 
> Trying to put all data in alt="" wouldn't work well, and
> 
> <img alt="world map showing most popular browser in each country">
> 
> doesn't contain the information that the map conveys, so that's at best a caption, not an alternative.
> 
> -- 
> regards, Kornel Lesiński
Received on Sunday, 13 May 2012 21:54:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT