Re: Initial comments on picture proposal

Am Mittwoch, 29. August 2012 um 23:47 schrieb Andy Davies:
> 3.1 Picture element permitted attributes & 3.2 Source element
> 
> Type makes sense as an attribute when src is specified but it's
> unclear how it fits when a srcset is specified with different image
> types and/or a fallback colour
> 
> 

Type should only be set per source so it's always the right type for the specific image.
If you use srcset you might not be able to set type.
But type attribute is not required, it's optional for future image formats and browser support.
You might be able to set one type for src-set which is applied to all sources specified in your srcset then.
This requires you to set every source the same type.
> 
> 4. Algorithms
> 
> If src and srcset are both specified on the picture or source element
> it's unclear which will be used (or is it assumed that src is the 1x
> image?)
> 
> 

src is only thought as fallback. AFAIK is @1x is standard and you have to specify @2x etc additionally. This has been in 
discussion at WHATWG and I am not sure what exactly was the solution. They wanted to have @2x as default size. 
> 
> Zooming
> 
> Perhaps this sentence "In these cases, user agents could select a
> higher-resolution version of an image to display." should be worded
> "In these cases, user agents MAY select a higher-resolution version of
> an image to display."

Agree. 
> 
> Media attribute
> 
> One of the areas where I 'struggle' with both the picture and srcset
> proposals is the media query - I understand why it's there but it
> seems likely that we're going to have a proliferation of media
> queries, which will result in maintenance headaches.
> 
> Unless we can come up with a 'better' solution perhaps we have to live
> with this in the short term and wait to see if Tab Atkins ideas for
> Cascading Attribute Sheets (CAS) come to fruition as they may offer a
> way to simplify things e.g.
> 
> CAS:
> 
> @media all and (min-width: 321px) and (max-width: 800px) {
> picture {
> srcset: attr(data-src-sml);
> }
> }
> 
> @media all and (min-width: 321px) and (max-width: 800px) {
> picture {
> srcset: attr(data-src-med);
> }
> }
> 
> @media all and (min-width: 801px) {
> picture {
> srcset: attr(data-src-lge);
> }
> }
> 
> HTML:
> 
> <picture data-src-sml="sml.jpg 1x, sml@2.jpg (mailto:sml@2.jpg) 2x" data-src-med="med.jpg
> 1x, med@2 2x" data-src-lge="lge.jpg 1x, lge@2.jpg (mailto:lge@2.jpg) 2x">
> </picture>

This is a topic that has to be addressed and there are several proposals yet (e.g. Matt Willcox's head-tpl).
I think this will come after the initial release of responsive images spec. 
> 
> I haven't considered the impact of the pre-fetcher that the above code
> might have.

This is part of the browser vendors. It seems that we cannot do anything particular here.

Thanks for your annotations,
-Anselm

Received on Thursday, 30 August 2012 07:47:10 UTC