Intent to Prototype: Auto Sizes for Lazy Loaded Images with Srcset

742 views
Skip to first unread message

Traian Captan

unread,
Jun 2, 2023, 12:10:16 AM6/2/23
to blink-dev, Traian Captan, Philip Rogers, Yoav Weiss, zco...@gmail.com

Contact emails

tca...@chromium.org

Explainer

https://github.com/whatwg/html/issues/4654

Specification

https://github.com/whatwg/html/pull/8008

Summary

Auto Sizes allows developers to omit the sizes attribute (or set it to sizes=auto) for lazy loaded image elements with srcset. For this use case the image's width should be provided. The browser will use the layout width of the image in order to select the source url from the srcset.



Blink component

Blink>Image

Motivation

The layout size information in sizes is redundant with layout information in CSS, but for images that are critical to initial paint it's necessary to have the information in the HTML. For lazy-loaded images, CSS will usually be available before the image load begins. The browser could take the actual width of the image as specified in CSS, and use that as if it was the image's sizes.



Initial public proposal

https://github.com/whatwg/html/issues/4654

Search tags

sizessizes=autoautosizessrcset

TAG review



TAG review status

Not applicable

Risks



Interoperability and Compatibility

None since all major browsers (Chrome, Safari and Firefox) indicate that they would be willing to implement it.



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/650)

WebKit: Positive (https://github.com/WebKit/standards-positions/issues/9)

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?



Debuggability



Is this feature fully tested by web-platform-tests?

Yes

Flag name

ImgAutoSizes

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1359051

Estimated milestones

DevTrial on desktop116
DevTrial on Android116


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5191555708616704

Links to previous Intent discussions



This intent message was generated by Chrome Platform Status.

Reply all
Reply to author
Forward
0 new messages