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

[whatwg] Problems with width/height descriptors in srcset

From: Simon Pieters <simonp@opera.com>
Date: Wed, 16 May 2012 14:13:59 +0200
To: "whatwg@whatwg.org" <whatwg@whatwg.org>
Message-ID: <op.weehllroidj3kv@simons-macbook-pro.local>
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.

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.

Even the spec seems confused about min-width vs max-width:

"The attribute essentially takes a comma-separated list of URLs each with  
one or more descriptors giving the maximum viewport dimensions and pixel  
density allowed to use the image."

Later:

"If there are any entries in candidates that have an associated width that  
is greater than max width, then remove them,"

The first quote should say "minimum viewport dimensions" to match the  
algorithm. Or vice versa, if the algorithm is wrong.

-- 
Simon Pieters
Opera Software
Received on Wednesday, 16 May 2012 12:14:39 GMT

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