Is 'sizes' required when using w in 'srcset' ?

MDN says so, although I see a lot of real-world examples that do away with it. What happens when no 'sizes' is present. Will the browser completely ignore the srcset, or pick a size based on the current layout size of the img element (scaled by the display density) ?
1 Reply
jcayzac
jcayzac•3mo ago
I can see currentSrc change by manually querying it in devtools, so the browser doesn't ignore the srcset as MDN claims it does. But whether I set img.onload or a mutation observer on currentSrc, I don't get any event 😦 Ohhh picking the right image in the absence of sizes is a firefox-only thing, apparently 😮 It's ironic that the Mozilla documentation is wrong only for the Mozilla browser 🙂
Want results from more Discord servers?
Add your server