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

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

From: Jeremy Keith <jeremy@adactio.com>
Date: Thu, 17 May 2012 18:59:05 +0100
Message-Id: <DE94BC96-206F-41D5-B369-2C1DB7B2C238@adactio.com>
To: whatwg@lists.whatwg.org
I wrote:
> Well, right now the spec text says:
> 
> "omitted width descriptors and height descriptors are considered to have the value "Infinity""
> 
> Does that mean I could ditch the 92000w and just leave it blank?
> 
> <img src="small.png" srcset="small.png 600w, medium.png 800w, large.png">

But I know realise that, according to the spec, I *must* specify at least one value. So actually I'd have to write:

<img src="small.png" srcset="small.png 600w, medium.png 800w, large.png 1x">

...which seems to muddy the waters a bit. I actually don't care about the pixel-density of the device in this case, but I need to write 1x because I have to include at least one value.

I much prefer Tab's suggestion:

> I think we should just go with a "min-width:100px" approach, which is much clearer.
> It also lets us add "max-width"


I asked:
> Related question: do we still want to keep this unit-less i.e. ditch the "px" from the examples above? Or, if we're going to use this CSS-like syntax anyway, allow other units of measurement (e.g. ems).

And Tab replied:
> No, if we're aping the CSS syntax more closely, we should just use CSS units.

I agree. Seems like the sensible approach. It also allows authors who are using ems for their media queries in CSS to also use ems for their srcset declarations.

Jeremy

-- 
Jeremy Keith

a d a c t i o

http://adactio.com/
Received on Thursday, 17 May 2012 17:59:43 GMT

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