[whatwg] add html-attribute for "responsive images"

2012/2/8 Kornel Lesi?ski <kornel at geekhood.net>:
> For DPI/filesize selection I'd prefer something simpler:
>
> <picture src="large.jpg" lowsrc="small.jpg"> <!-- or <source
> high-dpi-href="" or such> -->
> ?alternative <em>text</em>
> </picture>

Authors want the flexibility of having as few or as many source
elements as they want with whatever media queries they want, not
preset attributes. I don't think this would be adopted.

> When browser has a high-quality image the cached already, but media query
> for "network-connection: gprs" matches, it would be shame to force it to
> switch to a lousy image.

True. But that's mostly likely to happen on a phone, where its most
unlikley to have a high-quality image cached in the first place.

For me the immediate use case today is not serving an unnecessarily
large image (e.g bigger than the screen) to a browser, so it's less
wasteful, faster to load, and faster to render (whatever the
connection speed). It's not just about size or speed though. For
example, your layout might be different in landscape than in portrait,
so you might want a different aspect ratio version of the image. The
structure of <source>s with media queries keeps it flexible for
whatever the requirements are going forward (they will evolve).

Received on Wednesday, 8 February 2012 01:06:36 UTC