Found something interesting when I was playing around with srcset and retina sizing 1x, 2x etc.
When having an img element with srcset with 1x & 2x images, they behave mostly as you’d expect. If your DPR is 1, then you get the 1x image. If it’s 2, you get 2x.
However, as I was playing around with various DPRs to see how it worked out the logic of whether to serve the 1x or 2x in between those DPRs. I found something interesting. I’m not sure if this is a bug, or how it’s intended to work and I’m just unaware of the logic going on.
So, if I set the DPR to 1.41. Then I’m served the 1x image. If I set it to 1.42. Then I’m served the 2x image.
I’m not sure if it’s relevant, but the image in question was 182 x 142px wide, and the 2x exactly double that.
Any thoughts? @yoavweiss in particular?
Edit: This is in Chrome 43