Re: Proposed adaptive image element

On Jun 24, 2012, at 12:02 AM, Leif Halvard Silli wrote:

> Mathew Marquis, Thu, 21 Jun 2012 23:30:08 +0000:
>> a proposal for an adaptive image element to a W3C wiki here:
>> http://www.w3.org/community/respimg/wiki/Picture_Element_Proposal
> 
> Regarding the proposal in the wiki, then it deviates from "the markup 
> pattern established by the HTML video element' in the following details:
> 
>  * @src/@srcset is not allowed on the 'picture' container
>    <picture srcset="tall.jpg 1x, tall2.jpg 2x"></picture>
>  * @alt on the container element.

This would be more of a case for an `img` element using `srcset`, though I don’t see as they need to be mutually exclusive. I might _encourage_ authors to use `img` in the above case, but there’s no reason we shouldn’t be able to follow the same pattern as `video` here.

> 
> However, one argument against <picture> instead of an (overloaded)
> @srcset on <img>, is <picture>’s (default) lack of support for the
> <img> specific attributes such as @alt, @usemap and @ismap etc.
> 
> It also strikes me that, if first going for a <picture> element, then
> there are many things one would want to consider, such as mark-up based
> alternative text instead of attribute based alternative text.
> 
> One form of mark-up based alternative text could be to simply specify 
> alternative text to be provided via a child <img> element. One could go
> even further, perhaps, and let the <img> child element also provide e.g.
> the @usemap, @longdesc etc of the <picture>.
> 

Would it be possible to specify that the fallback `img` attributes apply to the parent `picture` in the event that the author has omitted those attributes from the parent `picture`? 

> The following 3 examples are more <video> pattern adhering than the 
> example in the wiki:
> 
>   Example 1: without @src/@srcset on container:
> 
> <picture>
> <img src="fallback.jpg" alt='alternative text' />
> <source media="(orientation:landscape)" srcset="long 1x,long2 2x">
> <source media="(orientation:portrait)"  srcset="tall 1x,tall2 2x">
> </picture>
> 
>   Example 2: with @src/@srcset on the container element:
> 
> <picture srcset="img 1x,img2 2x" >
> <img src="fallback.jpg" alt='alternative text' />
> </picture>
> 
>   Example 3: Like example 2 but no @src on the <img> element:
> 
> <picture srcset="img 1x,img2 2x" >
> <img alt='alternative text' />
> </picture>

The latter two examples are more of a case for an `img` using `srcset`, but again: there’s no reason `picture` shouldn’t be able to operate as such.

> 
> [1] 
> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/036160.html
> [2] 
> http://www.w3.org/mid/20120624050514401521.4e33ede6@xn--mlform-iua.no
> -- 
> Leif H Silli

Received on Monday, 25 June 2012 12:54:04 UTC