[whatwg] Defaulting new image solution to 192dpi

Kornel Lesiński kornel at geekhood.net
Thu May 17 05:39:05 PDT 2012

On Thu, 17 May 2012 13:20:03 +0100, Julian Reschke <julian.reschke at gmx.de>  

>> So to future-proof the solution I think:
>> <img src="1x.jpg" srcset="2x.jpg">
>> should be equivalent to:
>> <img src="1x.jpg" srcset="2x.jpg 2x">
>> ...
> As far as I can tell, making descriptors optional breaks the syntax (it  
> allows comma both in the URI and as a separator between image  
> candidates).

Indeed. I'm not sure which solution is the best:

- make descriptors optional only for the last URL (which will work fine  
for the case where only the 2x image is supplied)

srcset="a,b" is a single URL

srcset="a, b" is an invalid descriptor for a single URL

srcset="a 1x, b" is two URLs @1x and @2x

- parse trailing comma in URL as a separator and hope no URL scheme needs  
it :)

srcset="a,b" is a single URL

srcset="a, b" is two URLs

srcset="a,#, b" is two URLs, first one being "a,#".

- introduce some kind of escaping for commas in the URL part:

srcset="a,b" two URLs

srcset="a\,b" one URL "a,b"

srcset="a\\\, , \,b" two URLs "a\," and ",b"

regards, Kornel Lesiński

More information about the whatwg mailing list