Skip to content

Drop any candidate with a type descriptor if type is not supported #245

@eeeps

Description

@eeeps

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions