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

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

From: Julian Reschke <julian.reschke@gmx.de>
Date: Thu, 17 May 2012 14:53:40 +0200
Message-ID: <4FB4F4D4.6030509@gmx.de>
To: Kornel Lesiński <kornel@geekhood.net>
Cc: whatwg <whatwg@whatwg.org>
On 2012-05-17 14:39, Kornel Lesiński wrote:
> On Thu, 17 May 2012 13:20:03 +0100, Julian Reschke
> <julian.reschke@gmx.de> wrote:
>
>>> 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

Ugly.

> - 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,#".

Ugly.

> - 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"

Likely to be confusing because it's only needed in edge cases.

Or:

- delimit URIs in text content with "<" and ">" as suggested by RFC 3986 
(<http://greenbytes.de/tech/webdav/rfc3986.html#rfc.section.C>).

- don't use a microsyntax

Best regards, Julian
Received on Thursday, 17 May 2012 12:54:37 GMT

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