New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type() descriptor to srcset #210

Open
zcorpan opened this Issue Jun 9, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@zcorpan

zcorpan commented Jun 9, 2014

@tabatkins sayeth thus

I'd like to allow individual sources to specify a type as well with a ''type()'' function,
overriding the default type specified by the type attribute,
but I'm keeping things simple for now.

@zcorpan zcorpan added onhold labels Jun 9, 2014

@zcorpan

This comment has been minimized.

Show comment
Hide comment
@zcorpan

zcorpan Jun 9, 2014

So instead of

<picture>
  <source type="image/webp" srcset="dogs-1.webp, dogs-2.webp 2x">
  <source type="image/vnd.ms-photo" srcset="dogs-1.jxr, dogs-2.jxr 2x">
  <img src="dogs-1.jpg" srcset="dogs-2.jpg 2x"
       alt="Hundreds of hot dogs" width="600" height="200">
</picture>

You want to do this:

<img src="dogs-1.jpg" srcset="dogs-1.webp type(image/webp), dogs-2.webp 2x type(image/webp),
     dogs-1.jxr type(image/vnd.ms-photo), dogs-2.jxr 2x type(image/vnd.ms-photo),
     dogs-2.jpg 2x"
     alt="Hundreds of hot dogs" width="600" height="200">

?

zcorpan commented Jun 9, 2014

So instead of

<picture>
  <source type="image/webp" srcset="dogs-1.webp, dogs-2.webp 2x">
  <source type="image/vnd.ms-photo" srcset="dogs-1.jxr, dogs-2.jxr 2x">
  <img src="dogs-1.jpg" srcset="dogs-2.jpg 2x"
       alt="Hundreds of hot dogs" width="600" height="200">
</picture>

You want to do this:

<img src="dogs-1.jpg" srcset="dogs-1.webp type(image/webp), dogs-2.webp 2x type(image/webp),
     dogs-1.jxr type(image/vnd.ms-photo), dogs-2.jxr 2x type(image/vnd.ms-photo),
     dogs-2.jpg 2x"
     alt="Hundreds of hot dogs" width="600" height="200">

?

@eeeps

This comment has been minimized.

Show comment
Hide comment
@eeeps

eeeps Jun 9, 2014

First type match wins, or is there a browser-specific preferred, ordered list of handle-able types, or...?

eeeps commented Jun 9, 2014

First type match wins, or is there a browser-specific preferred, ordered list of handle-able types, or...?

@eeeps

This comment has been minimized.

Show comment
Hide comment
@eeeps

eeeps Jun 9, 2014

Given the "browser decides" nature of srcset, I'd be 100% behind the browser picking the type to use... if you, the author want to impose your own agenda, use picture & source type.

eeeps commented Jun 9, 2014

Given the "browser decides" nature of srcset, I'd be 100% behind the browser picking the type to use... if you, the author want to impose your own agenda, use picture & source type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment