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

Seemingly contradictions in the srcset attribute guidelines for Images #3250

Closed
treyeckels opened this Issue Nov 22, 2017 · 6 comments

Comments

6 participants
@treyeckels

treyeckels commented Nov 22, 2017

https://html.spec.whatwg.org/multipage/images.html#srcset-attributes

If an element has a srcset attribute present, all image candidate strings for that element must have the width descriptor specified.

This seems like this contradicts what is stated above it (and pasted below in this issue) in that an image candidate string for that element must have 0 or one of the following: a width descriptor or a pixel density descriptor.

Zero or one of the following:​

A width descriptor, consisting of:​ ASCII whitespace, a valid non-negative integer giving a number greater than zero representing the width descriptor value, and a U+0077 LATIN SMALL LETTER W character.

A pixel density descriptor, consisting of:​ ASCII whitespace, a valid floating-point number giving a number greater than zero representing the pixel density descriptor value, and a U+0078 LATIN SMALL LETTER X character.

It sounds like it is saying in 1 spot that you can only have one or the other (or none) and then the other says they must all have the width descriptor.

@tabatkins

This comment has been minimized.

Show comment
Hide comment
@tabatkins

tabatkins Nov 28, 2017

Collaborator

Yeah, that line seems... very wrong.

Collaborator

tabatkins commented Nov 28, 2017

Yeah, that line seems... very wrong.

@zcorpan

This comment has been minimized.

Show comment
Hide comment
@zcorpan

zcorpan Dec 5, 2017

Member

This must have regressed at some point. It should say

If an element has a sizes attribute present, all image candidate strings for that element must have the width descriptor specified.

Member

zcorpan commented Dec 5, 2017

This must have regressed at some point. It should say

If an element has a sizes attribute present, all image candidate strings for that element must have the width descriptor specified.

@Johanna-hub

This comment has been minimized.

Show comment
Hide comment
@Johanna-hub

Johanna-hub Oct 8, 2018

Contributor

Hi,

Could I take this on as a first contribution please?

Contributor

Johanna-hub commented Oct 8, 2018

Hi,

Could I take this on as a first contribution please?

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Oct 8, 2018

Member

Hi @Johanna-hub, you sure can. Hopefully https://github.com/whatwg/html/blob/master/CONTRIBUTING.md has enough information for you to get started, otherwise please let this thread know and someone will help you out. Thanks!

Member

annevk commented Oct 8, 2018

Hi @Johanna-hub, you sure can. Hopefully https://github.com/whatwg/html/blob/master/CONTRIBUTING.md has enough information for you to get started, otherwise please let this thread know and someone will help you out. Thanks!

@Johanna-hub

This comment has been minimized.

Show comment
Hide comment
@Johanna-hub

Johanna-hub Oct 8, 2018

Contributor

Thank you very much @annevk 🙂. I have submitted a PR, I have signed the participation form but maybe it takes some time to update. Please let me know if there are any problems.

Contributor

Johanna-hub commented Oct 8, 2018

Thank you very much @annevk 🙂. I have submitted a PR, I have signed the participation form but maybe it takes some time to update. Please let me know if there are any problems.

@annevk annevk closed this in #4068 Oct 9, 2018

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Oct 9, 2018

Member

Thanks @treyeckels for reporting and @Johanna-hub for fixing! Much appreciated.

Member

annevk commented Oct 9, 2018

Thanks @treyeckels for reporting and @Johanna-hub for fixing! Much appreciated.

annevk added a commit that referenced this issue Oct 9, 2018

Fix srcset attribute guidelines
Conformance requirement for the width descriptor is about the sizes attribute, not the srcset attribute.

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