Hacker News new | past | comments | ask | show | jobs | submit login

The UA can do whatever it wants; the information given in srcset is for giving the UA the clues it needs to make the right decision. [0]

> From the available options, the user agent then picks the most appropriate image.

So if you are zoomed in, the UA can decide that a higher-res image is the most appropriate one.

[0]: http://www.whatwg.org/specs/web-apps/current-work/multipage/...




It's not providing the right information for a decision, it's trying to prejudge that decision based on one factor (screen resolution).

On top of that the syntax is awful and appears to have been chosen to make browser vendors' lives slightly easier - I went and had a look at the links you gave to hixie's reasoning, and it's all based on minor difficulties browsers had parsing audio/video, but they've already done that work, why introduce yet another sub format within an attribute?


The "2x" describes the image, not a property of the device that image is being viewed on.

If I have an image meant to be displayed in a 250x250 area of layout, a 500x500 "retina-ready" image will not fit. The browser must be told that the image is meant to be displayed "@2x" (as Apple puts it). This is what the "2x" is for. The browser is allowed to use any or none of that information in its decision making.

The syntax of srcset="" was chosen to match CSS's image-set syntax. The <audio>/<video> pattern wasn't great for anyone.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: