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

[whatwg] Fallback for <picture>

From: Kornel Lesiński <kornel@geekhood.net>
Date: Sun, 13 May 2012 21:20:43 +0100
To: "whatwg@whatwg.org" <whatwg@whatwg.org>
Message-ID: <op.wd9j4toete2ec8@aimac.local>
Cc: mat@matmarquis.com

Syntax used on the wiki:

places alt on the new element:

<picture alt="alt">
     <source …>

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.

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

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.

     <source …>
     <img alt="This is unstructured fallback">


     <source …>
     This is <em>structured</em> fallback

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:

     <table><tr><th>Country</th><th>Most popular browser</th>...

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 20:21:21 UTC

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