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

Re: [whatwg] srcset isn't future-friendly to screen size differences

From: Hans Muller <hmuller@adobe.com>
Date: Fri, 7 Sep 2012 09:21:38 -0700
To: "Tab Atkins Jr." <jackalmage@gmail.com>, WHATWG List <whatwg@whatwg.org>
Message-ID: <CC6F6A83.16FED%hmuller@adobe.com>
Cc: John Mellor <johnme@chromium.org>

On 9/6/12 6:36 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

>Consider the following example:
>
><img srcset="800.jpg 1x, 1600.jpg 2x" style="width: 100%; height: auto;">
>
>For a screen that's somewhere near 800px wide, this works just fine.
>However, a 1x screen 1600px wide (not too uncommon - I think a 19"
>monitor is roughly that width) will get served the 800.jpg image,
>which then gets blown up to an unattractive level.

In this particular case, without considering other display densities,
wouldn't this suffice:

   <img src="1600.jpg" srcset="800.jpg 800w 1x, 1600.jpg 800w 2x"
style="width: 100%; height: auto;">

It's a shame that one can't explicitly say that the UA can use display
density 
arithmetic to select substitute images.  On the other hand, ror cases like
this, 
specifying a src image for viewports that are "larger" than the ones
specified 
with srcset seems like a good idea.

- Hans




> 
Received on Friday, 7 September 2012 16:22:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC