arielsalminen / feature.js

Feature.js is a fast, simple and lightweight browser feature detection library in 1kb.
https://featurejs.com/
3.17k stars 115 forks source link

false negative for <img> sizes parameter in Safari #44

Open blinkcursor opened 8 years ago

blinkcursor commented 8 years ago

Safari does now support srcset and sizes, but for some reason sizes is not available on the img object, and so your test reports that Safari doesn't have support.

(I really want to be able to set sizes on some dynamically added content, so if anyone knows if sizes is available through some other means please let me know.)

mynamesleon commented 8 years ago

Which version of Safari did you try this on? Safari 8 supported srcset, but not the sizes attribute. Safari 9 supports both, and reports both as true.

I will add to this though. Checking for sizes in an image object does report false positives in older versions of Firefox that didn't support srcset - a more reliable check would be to check for both srcset and sizes support in the sizes check

meowsus commented 5 years ago

Thanks @blinkcursor and @mynamesleon. I'll dig in in a bit!