You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Srcset implementations do not take width as a fallback when sizes is not present #5893
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.
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.
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.
Activity
zcorpan commentedon Sep 7, 2020
As far as I can tell, it's implemented in chromium/webkit/gecko. Compare with nowidthorsizesattribute, which defaults to 100vw.zcorpan commentedon Sep 7, 2020
I think that change doesn't influence much for this behavior. The
widthattribute could be overridden with CSS before just like now. It's also a fallback that is only used in invalid documents, since thesizesattribute is required whensrcsetusesw.zcorpan commentedon 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 fromsizesis used for rendering, which is 100vw in chromium/webkit/gecko.OK, since it's not implemented, removing it seems fine.
annevk commentedon Sep 9, 2020
Agreed.
Remove width attribute fallback from sizes calculation
Remove width attribute fallback from sizes calculation
Remove dangling "fallback width" and "width" references
Remove dangling "fallback width" and "width" references
Remove dangling "fallback width" and "width" references