Live data from Hacker News

First draft of HTML img srcset for responsive images

whatwg.org

71–79 of 79 posts

Re: First draft of HTML img srcset for responsive images

#71

Earlier quoted context omitted.

what is stopping this approach from addressing that use case?

No file format exists which supports this use case.

i wonder if you could do it with separate frames of a GIF? there's no reason they have to be played as an animation. (they don't even have to be the same size as each other or the logical screen, afaict.)

Re: First draft of HTML img srcset for responsive images

#72

Earlier quoted context omitted.

No file format exists which supports this use case.

i wonder if you could do it with separate frames of a GIF? there's no reason they have to be played as an animation. (they don't even have to be the same size as each other or the logical screen, afaict.)

I don't see how the client could selectively download frames. GIF isn't really the nicest file format anyway.

Re: First draft of HTML img srcset for responsive images

#73

Earlier quoted context omitted.

You would need to turn on caching on your query strings in order for this idea to be useful with a cdn (ie, both http://example.org/image.png?size=big and http://example.org/image.png?size=small would need to be cached by the cdn). The issue is if you use some sort of user tracking, or rss feed, or anything that appends unique data to the end of the URL (so http://example.org/image.png?size=small could become somethi…

why is your user tracking appending data onto the end of a CDN image? This hypothetical web site makes no sense.

The last time I had to deal with this it was a result of links to a site from an email being attached to the user it was sent to (eg example.com/?email=foo@bar.com). It was not a wonderful example, just a quick one. The moral being by caching query strings you risk needing to parse the ones being passed to ensure there in not unnecessary caching.

Re: First draft of HTML img srcset for responsive images

#74

Earlier quoted context omitted.

why is your user tracking appending data onto the end of a CDN image? This hypothetical web site makes no sense.

The last time I had to deal with this it was a result of links to a site from an email being attached to the user it was sent to (eg example.com/?email=foo@bar.com). It was not a wonderful example, just a quick one. The moral being by caching query strings you risk needing to parse the ones being passed to ensure there in not unnecessary caching.

This use case seems abusive to me. I don't mind breaking abusive use cases.

Re: First draft of HTML img srcset for responsive images

#75

Earlier quoted context omitted.

i wonder if you could do it with separate frames of a GIF? there's no reason they have to be played as an animation. (they don't even have to be the same size as each other or the logical screen, afaict.)

I don't see how the client could selectively download frames. GIF isn't really the nicest file format anyway.

can you fetch arbitrary byte ranges over http? i don't know the details of the GIF chunk format, but often there's a header or something that you could use to calculate what other part of the file you want.

(yes, this is almost certainly a terrible way to implement it, but i was curious as to whether it could be shoehorned in.)

Re: First draft of HTML img srcset for responsive images

#76

Earlier quoted context omitted.

I don't see how the client could selectively download frames. GIF isn't really the nicest file format anyway.

can you fetch arbitrary byte ranges over http? i don't know the details of the GIF chunk format, but often there's a header or something that you could use to calculate what other part of the file you want. (yes, this is almost certainly a terrible way to implement it, but i was curious as to whether it could be shoehorned in.)

You can, but this is server dependent and not possible with the GIF format. If you were to construct a format where this is possible, this would mean a minimum of two HTTP requests and quite possible three since the header would have to be of variable length.

Additionally, trying to get browsers to consistently implement something of this level of complexity sounds dangerous.

Re: First draft of HTML img srcset for responsive images

#77

Earlier quoted context omitted.

The last time I had to deal with this it was a result of links to a site from an email being attached to the user it was sent to (eg example.com/?email=foo@bar.com). It was not a wonderful example, just a quick one. The moral being by caching query strings you risk needing to parse the ones being passed to ensure there in not unnecessary caching.

This use case seems abusive to me. I don't mind breaking abusive use cases.

Neither did XHTML.

Web Standards work requires you put up with a ton of really stupid things that people have been doing for a long time.

Re: First draft of HTML img srcset for responsive images

#78

Earlier quoted context omitted.

This use case seems abusive to me. I don't mind breaking abusive use cases.

Neither did XHTML. Web Standards work requires you put up with a ton of really stupid things that people have been doing for a long time.

I don't mean abusive in the sense that it's using technology in a way it was not intended to be used. I mean abusive as in actively harmful to the user's interests and privacy.

Re: First draft of HTML img srcset for responsive images

#79
post #62

Earlier quoted context omitted.

Not a good idea. Browsers that do not support imgset would show all three images using that syntax. A new element name like " " would be ignored by them.

CSS to the rescue imgset img{display:none;} imgset img:first-child{display:block;} Same with modern HTML5 tags, modernizer or any other tool would handle that for you.

Not really, what about browsers that don't support first-child? Backwards compatibility is important.
Post reply on HN