Earlier quoted context omitted.
That is a very appealing design, but sadly it doesn't address all the use cases. In particular one thing that people want to be able to do is to display a different image depending on the viewport dimensions, for example a closer crop on a small screen compared to that shown on a larger screen.
what is stopping this approach from addressing that use case?
First draft of HTML img srcset for responsive images
51–60 of 79 posts
Re: First draft of HTML img srcset for responsive images
#52Earlier quoted context omitted.
No, this won't work in the wild. It breaks caching completely. It requires scripting just to serve an image. The same url can have different data - imagine if you resume downloading a file, only to suddenly have a different file.
I disagree. Caches would have to be intelligent. Remember they already have to pay attention to language headers etc. URLs represent a conceptual resource, rather than a single file.
Re: First draft of HTML img srcset for responsive images
#53Re: First draft of HTML img srcset for responsive images
#54Re: First draft of HTML img srcset for responsive images
#55Earlier quoted context omitted.
what is stopping this approach from addressing that use case?
No file format exists which supports this use case.
Re: First draft of HTML img srcset for responsive images
#56Bonus point, less cluttered HTML.
Re: First draft of HTML img srcset for responsive images
#57I believe this should be moved to the stylesheet. We already have ways to determine media/viewport/device/orientation etc so adding different imgs would be a no brainer. Bonus point, less cluttered HTML.
Re: First draft of HTML img srcset for responsive images
#58Earlier quoted context omitted.
Using CSS means you have to specify image locations in two places, with potentially different base URLs. Using Javascript means you have to load scripts before the img tag, which can hurt performance. Using http headers or a special URL format makes working with CDNs more difficult. This is actually a tricky problem to solve and it looks like the authors have considered some of the above problems. (I still hope they…
wait hold on how does having a query string in a url make CDN's more difficult?
Re: First draft of HTML img srcset for responsive images
#59This is silly and makes things way more complicated than they need to be. We have HTML tags, to which we can apply attributes directly via blah=blah syntax Or we can add attributes by making a style attribute, and using css syntax inside of it. Or we can have a space separated list of class names, and have attributes applied to an element externally by a CSS stylesheet. Or we can have an ID, and apply attributes usin…