[webkit-dev] The SrcN responsive images proposal

Benjamin Poulain benjamin at webkit.org
Wed Nov 6 14:33:00 PST 2013


On 11/6/13, 10:53 AM, John Mellor wrote:
> On Sun, Oct 20, 2013 at 2:00 AM, Maciej Stachowiak <mjs at apple.com
> <mailto:mjs at apple.com>> wrote:
>  >
>  > My initial impression is that it seems a bit overengineered.
>
> I sympathize. The issue of srcN appearing to be a complex solution to a
> seemingly simple problem came up again on IRC chatting to rniwa, so I
> thought I'd try to explain this briefly.
>
> Unfortunately, responsive images is a deceptively complex problem. There
> are 3 main use cases:
> 1. dpr-switching: fixed-width image resolution based on devicePixelRatio.
> 2. viewport-switching: flexible-width image resolution based on viewport
> width and devicePixelRatio.
> 3. art direction: same as #1 or #2, except additionally, must serve
> completely different images based on viewport width.

How important and common are each of those use cases?
Handling every imaginable use case by the Engine is a non-goal.

There has been a lot of demand for dpr-switching since the first iPad 
Retina. This has caused some very ugly hacks on the Web. It is very 
important to address that issue.

Viewport switching is usually done to adapt images for mobile device VS 
large/huge display devices. It is a valid concern but it is not easily 
addressed. Srcset can/should likely be improved regarding this.

I believe (feel free to prove me wrong) dynamic viewport adaptation and 
what you call "art direction" is not as common.
I have the feeling those corner cases may be better addressed with 
JavaScript.


In my opinion WebKit should not support srcN in its current form. We are 
here to make the web a better/friendlier platform. The srcN proposal 
does not do that, it is a catch all that makes the important use cases 
more difficult.

Benjamin


More information about the webkit-dev mailing list