Re: [csswg-drafts] [css-sizing-4][css-contain-2] Revisiting auto-sizing when size-containment applies (#5668)

Unless it's a very specific nitpick of a line in the comment, I generally prefer comments to go in the issue, as it's easier to keep track of them.

------

**[@vmpstr said:](https://github.com/w3c/csswg-drafts/commit/16aad72a7c438e6a98a399cca0161a82d6f3a2c0#r46759280)**
> The problem here is for an optimization that content-visibility: auto provides to be effective, we need to ensure that we can skip layout of the contents as soon as we render the element.

You're right; I misremembered what content-visibility:auto did, and thought it applied size containment, meaning we *had* to get an experimental layout in anyway (and at that point, might as well do it early for all cases). But nope, an element with *skipped contents* gets size containment; once an "auto" element is not skipped, it lays out without size containment (assuming nothing else is applying it, of course).

So yeah, I definitely could just wait for that layout to happen and start recording the size *then*; before that (while it's skipped), it just doesn't have a remembered size.

--------

Question: should it forget its last remembered size if it loses `contain-intrinsic-size:auto`? I presume we don't want to record this information for *all elements all the time*, so the restriction to only do the recording when c-i-s:auto is on makes sense, but is it better to forget the size when c-i-s:auto no longer applies, or remember it permanently from then on (even tho it won't be used until you set c-i-s:auto again)?

The way the spec is currently written, once an element records a size it keeps it forever, but I'm happy to make it forget (presumably with the same timing?).

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5668#issuecomment-773699221 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 5 February 2021 00:38:35 UTC