Live data from Hacker News

First draft of HTML img srcset for responsive images

whatwg.org

1–10 of 79 posts

Re: First draft of HTML img srcset for responsive images

#4
> "2x" means "maximum pixel density of 2 device pixels per CSS pixel"

I don't understand why that's maximum pixel density and not minimum pixel density.

If I'm using a super-retina device with 4x pixel density, surely it's better for me to get the 2x image than the default (presumably 1x) image?

Re: First draft of HTML img srcset for responsive images

#5
post #3

I think lots of informal URLs consist U+002C COMMA character (,) Why not ? Is this against SGML syntax?

That is against sgml syntax, yes.

There must be at least one height / width / pixel density descriptor for each url, so if you see a comma before the url ends, you know it must be part of the url.

Re: First draft of HTML img srcset for responsive images

#6
post #4

> "2x" means "maximum pixel density of 2 device pixels per CSS pixel" I don't understand why that's maximum pixel density and not minimum pixel density. If I'm using a super-retina device with 4x pixel density, surely it's better for me to get the 2x image than the default (presumably 1x) image?

The algorithm actually picks the resource you would expect there so that is a bug in the note. Filed a bug:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17057

Re: First draft of HTML img srcset for responsive images

#9
post #7

I like the concept, but the syntax feels awkward, clunky and very specific. Why not repurpose the media attribute from style tags to all other tags?

Because it is way more verbose and does not address the pixel density case.

But pixel density is a property of the media, which should be dealt with by media queries.
Post reply on HN