forked from Wilto/draft-prop
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
Description
If/when #210 becomes real, I think a lot of people are going to want to do:
<img src="jpg.jpg"
srcset="webp.webp type(image/webp),
jxr.jxr type(image/vnd.ms-photo)"
alt="" />
...because it feels a lot like:
<img src="jpg.jpg"
srcset="retina.jpg 2x,
super-retina.jpg 3x"
alt="" />
...which works.
Currently, though, in browsers that don’t understand type()
it is simply ignored and both candidates get assigned 1x
. The first is chosen, and the browser tries to load the WebP – if the browser doesn’t support WebP, the user gets a broken image, even though there was a perfectly good Jpeg sitting right there in the src
fallback.
Browsers that don’t support type()
shouldn’t try to load formats that they may or may not understand.