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

Re: [whatwg] Defaulting new image solution to 192dpi

From: Kornel Lesiński <kornel@geekhood.net>
Date: Thu, 17 May 2012 13:39:05 +0100
To: "Julian Reschke" <julian.reschke@gmx.de>
Message-ID: <op.wegdffj2te2ec8@aimac.local>
Cc: whatwg <whatwg@whatwg.org>
On Thu, 17 May 2012 13:20:03 +0100, Julian Reschke <julian.reschke@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
Received on Thursday, 17 May 2012 12:39:40 UTC

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