[css-sizing-4] Only apply contain-intrinsic-size: auto with content-visibility: auto · Issue #6308 · w3c/csswg-drafts (original) (raw)
https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override
If auto
applies to everything, you can into the situation where an element is visible on screen but rendered with outdated dimensions. For example:
Now, if JS adds contain: size; width: auto;
, the element will be rendered at 200px width, even though this size is neither in the current CSS style not is it related to the content size.
This is an unfortunate situation. To fix this, we would like to propose only applying auto
if the element also has content-visibility: auto
. This would ensure that the remembered size is only used if the element is offscreen, where an outdated size will only affect the scrollbar size.
Thoughts?