Initial comments on picture proposal

Need to re-read the proposal but here's some questions and suggestions
that came up while I was reading it...

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


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?)


A. Use Cases

Probably need to add something like the following to indicate images
might be changed based on bandwidth

3. The need for different image sources depending on throughput of the
network connection


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



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 2x" data-src-med="med.jpg
1x, med@2 2x" data-src-lge="lge.jpg 1x, lge@2.jpg 2x">
</picture>

I haven't considered the impact of the pre-fetcher that the above code
might have.

These are just my initial thoughts and questions, will probably be more...

Cheers

Andy

Received on Wednesday, 29 August 2012 21:47:31 UTC