Earlier 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.
First draft of HTML img srcset for responsive images
31–40 of 79 posts
Re: First draft of HTML img srcset for responsive images
#32This 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…
Although in general things that make authoring easier are preferred, designs that are easy to implement in a bug-free way are generally preferred over designs that are complex and likely to lead to interoperability issues. After all, having to fight implementation differences is a rather common complaint about the web platform.
It also hasn't been clearly demonstrated that multiple elements are easier to work with. They are more familiar, but significantly more verbose. I don't know how that plays out in practice.
Re: First draft of HTML img srcset for responsive images
#33Earlier quoted context omitted.
The approach also has a sort of solution for degrading gracefully in older browsers. You can nest an in your . Newer browsers are supposed to ignore it, older browsers would ignore the surrounding element instead. I think there are other good reasons to prefer the srcset approach, but not this one. The email here provides motivation: http://lists.w3.org/Archives/Public/public-whatwg-archive/20... ;
Unfortunately, at the time when Ian didn't seem to care about the issue of responsive images, I asked him about the possibility of using the existing ` ` element and he said it was pointless to try and modify existing image parsing. Forget it. Now, he decides that actually this is the way to go. Frustrating. For reference, in the email linked above, Ian Hickson said: > So why not just give the UA the characteristics…
Re: First draft of HTML img srcset for responsive images
#34This 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…
From an implementation point of view, putting everything in a single attribute is way simpler; the design of is quite problematic. The reason is that with a single attribute everything can be processed atomically. With a design based on multiple elements things can happen between elements being processed, creating many more edge cases. Although in general things that make authoring easier are preferred, designs that…
Re: First draft of HTML img srcset for responsive images
#35This 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…
From an implementation point of view, putting everything in a single attribute is way simpler; the design of is quite problematic. The reason is that with a single attribute everything can be processed atomically. With a design based on multiple elements things can happen between elements being processed, creating many more edge cases. Although in general things that make authoring easier are preferred, designs that…
Re: First draft of HTML img srcset for responsive images
#36Re: First draft of HTML img srcset for responsive images
#37Re: First draft of HTML img srcset for responsive images
#38Or, here's just a crazy out there thought. What if we save our images in high res progressive format, and program the browsers to stop downloading the images as soon as they've acquired enough resolution? Caching can be done with http range requests. Older user agents just end up downloading larger images than they wanted. Javascript and server script can use the JPEGtran library to retrieve lossless low res versions…
Re: First draft of HTML img srcset for responsive images
#39Better than this specification hassle is this solution: The browser should send the density of the screen in ppi (calculated by the screen resolution and the screen information provided by the OS) together with all the other standard stuff like OS, screen resolution, etc. With this information the server can decide which images to send.
Re: First draft of HTML img srcset for responsive images
#40I would rather see a solution implemented with CSS or even a meta tag.
The above example is exactly the same information as in this link. However it is expressed in one place and thus is far simpler. The only reason to do this per image would be if you different naming conventions for individual images.. which would just be silly.
You could then have a nosrcset attribute which you can add to images which do not have high-res versions. This would save an http request.