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

Re: [whatwg] <img srcset> for responsive bitmapped content images

From: Julian Reschke <julian.reschke@gmx.de>
Date: Wed, 16 May 2012 11:22:07 +0200
Message-ID: <4FB371BF.201@gmx.de>
To: Edward O'Connor <eoconnor@apple.com>
Cc: whatwg@whatwg.org
On 2012-05-10 09:58, Edward O'Connor wrote:
> Hi,
>
> When authors adapt their sites for high-resolution displays such as the
> iPhone's Retina display, they often need to be able to use different
> assets representing the same image. Doing this for content images in
> HTML is currently much more of a pain than it is in CSS (and it can be a
> pain in CSS). I think we can best address this problem for bitmap[1]
> content image by the addition of a srcset="" attribute to the existing
> <img>  element.
>
> The srcset="" attribute takes as its argument a simplified variant of
> the image-set() microsyntax[2]. It would look something like this:
>
> <img src="foo-lores.jpg"
>       srcset="foo-hires.jpg 2x, foo-superduperhires.jpg 6.5x"
>       alt="decent alt text for foo.">
> ...

Inventing a new microsyntax is tricky.

- "comma separated" implies you'll need to escape a comma when it 
appears in a URI; this may be a problem when the URI scheme assigns a 
special meaning to the comma (so it doesn't affect HTTP but still...)

- separating URIs from parameters with whitespace implies that the URIs 
are valid (in that they do not contain whitespace themselves); I 
personally have no problem with that, but it should be kept in mind

Best regards, Julian
Received on Wednesday, 16 May 2012 09:22:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT