Intent to Prototype: auto keyword for contain-intrinsic-size

57 views
Skip to first unread message

Christian Biesinger

unread,
Apr 16, 2021, 5:38:50 PMApr 16
to blink-dev
Contact emails
cbies...@chromium.org, vmp...@chromium.org

Explainer

https://gist.github.com/cbiesinger/f2378dbcd215495c3a1daf9696a8e91f

Specification
https://drafts.csswg.org/css-sizing-4/#last-remembered

Summary
Support for the "auto" keyword in contain-intrinsic-size lets web
sites use the last remembered size of an element (if any), which
providers for a better user experience as elements have size
containment turned on and off, e.g. through content-visibility: auto.



Blink component
Blink>Layout

Motivation
Without this feature, web developers have to guess at the rendered
size of the element; when used with content-visibility: auto, this may
lead to elements "jumping around".



Initial public proposal
None

Search tags
contain-intrinsic-size, contain intrinsic size, auto

TAG review
https://github.com/w3ctag/design-reviews/issues/624

TAG review status
Pending

Risks


Interoperability and Compatibility
No compat risk; all existing CSS will continue to work unchanged.

Interop risk: if web developers only use the new syntax, then content
will be sized as 0x0. They can use the usual CSS fallback syntax to
avoid this, like:

contain-intrinsic-size: 100px 100px;
contain-intrinsic-size: auto 100px auto 100px;



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/512)

WebKit: No signal
(https://lists.webkit.org/pipermail/webkit-dev/2021-April/031787.html)

Web developers: Positive (https://github.com/w3c/csswg-drafts/issues/5815)

Ergonomics
Possible risk is that this requires using resize observer internally
to get the last rendered size. We think this will not be an issue in
practice.



Activation
Very easy; easier than the existing contain-intrinsic-size (which is the point)



Security
n/a



Debuggability
Same as any other CSS property.



Is this feature fully tested by web-platform-tests?
No
I will write WPT tests as part of the implementation

Flag name


Tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=1199460

Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/6740477866934272

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages