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

Re: [whatwg] Problems with width/height descriptors in srcset

From: Simon Pieters <simonp@opera.com>
Date: Mon, 21 May 2012 08:28:56 +0200
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Message-ID: <op.wenayiryidj3kv@simons-macbook-pro.local>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>
On Wed, 16 May 2012 18:25:58 +0200, Tab Atkins Jr. <jackalmage@gmail.com>  
wrote:

> On Wed, May 16, 2012 at 5:13 AM, Simon Pieters <simonp@opera.com> wrote:
>> The width/height descriptors in srcset seem to be difficult for people  
>> to
>> get right, even people who read the spec.
>>
>> * It's not clear from the syntax that it refers to the viewport size  
>> rather
>> than the image size.
>> * It's not clear if it's min-width or max-width.
>
> Absolutely agreed.  Like several others have suggested, I think we
> should just go with a "min-width:100px" approach, which is much
> clearer.

Though that still doesn't make it clear that it refers to the viewport  
size rather than the image size. Or does it?


>  It also lets us add "max-width", though that may complicate
> the resource choosing algorithm a bit.
>
> ~TJ

Does doing so solve any use cases?


On Wed, 16 May 2012 14:13:59 +0200, Simon Pieters <simonp@opera.com> wrote:

> Also, since the fallback image participats as a candidate, but you  
> cannot change its descriptors, you are not free to use any of the images  
> as the fallback image. You might either want the narrowest image to be  
> the fallback, or the widest image, or one in between, but the syntax  
> doesn't allow choice, AFAICT.

To solve this problem, I propose that we allow the src URL to be specified  
in srcset, and when it is, don't add src as a candidate. It would be good  
with a keyword "inf" or "infinity" as a width descriptor in this case so  
you don't need to specify "1x" when you want infinity.

-- 
Simon Pieters
Opera Software
Received on Monday, 21 May 2012 06:29:59 GMT

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