Skip to content
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

Srcset implementations do not take width as a fallback when sizes is not present #5893

Closed
yoavweiss opened this issue Sep 7, 2020 · 4 comments · Fixed by #5900
Closed

Srcset implementations do not take width as a fallback when sizes is not present #5893

yoavweiss opened this issue Sep 7, 2020 · 4 comments · Fixed by #5900
Labels
removal/deprecation Removing or deprecating a feature topic: img

Comments

@yoavweiss
Copy link
Collaborator

While looking into #4968, I noticed that HTML's parsing a sizes attribute is taking the image element's width into account as the fallback, in case sizes is not present.
This used to make sense, before the changes made in WICG/intrinsicsize-attribute#16 (comment)
Since width no longer implies absolute pixel values, it no longer does, and I think we should remove that.

Looking at the different implementations (test page - needs to be tested on 1 DPR screen), none of them treats width as the fallback value, meaning we can easily remove that from the spec.

@zcorpan @annevk @chrishtr - thoughts?

@zcorpan
Copy link
Member

zcorpan commented Sep 7, 2020

As far as I can tell, it's implemented in chromium/webkit/gecko. Compare with no width or sizes attribute, which defaults to 100vw.

@zcorpan
Copy link
Member

zcorpan commented Sep 7, 2020

This used to make sense, before the changes made in WICG/intrinsicsize-attribute#16 (comment)
Since width no longer implies absolute pixel values, it no longer does, and I think we should remove that.

I think that change doesn't influence much for this behavior. The width attribute could be overridden with CSS before just like now. It's also a fallback that is only used in invalid documents, since the sizes attribute is required when srcset uses w.

@zcorpan
Copy link
Member

zcorpan commented Sep 7, 2020

Hmm, wait. I was confused in my first comment. A clearer test is <img width=400 style="width: auto" ...>, where the intrinsic size from sizes is used for rendering, which is 100vw in chromium/webkit/gecko.

OK, since it's not implemented, removing it seems fine.

@annevk annevk added the removal/deprecation Removing or deprecating a feature label Sep 9, 2020
@annevk
Copy link
Member

annevk commented Sep 9, 2020

Agreed.

eeeps added a commit to eeeps/html that referenced this issue Sep 20, 2021
...from the "Updating the source set" algorithm.

Mop-up for Issue whatwg#5893, completing work started in PR whatwg#5900.
zcorpan pushed a commit that referenced this issue Sep 20, 2021
...from the "Updating the source set" algorithm.

Mop-up for Issue #5893, completing work started in PR #5900.
mfreed7 pushed a commit to mfreed7/html that referenced this issue Jun 3, 2022
...from the "Updating the source set" algorithm.

Mop-up for Issue whatwg#5893, completing work started in PR whatwg#5900.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
removal/deprecation Removing or deprecating a feature topic: img
Development

Successfully merging a pull request may close this issue.

3 participants