[csswg-drafts] [css sizing] auto <length> description may have wrong "otherwise" (#7769)

hamishwillee has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css sizing] auto <length> description may have wrong "otherwise" ==
For `contain-intrinsic-size: auto <length>` my understanding is that the intent is that if the content has never been rendered you won't have a remembered value, so you will use the `length` value for size constrained layout. If however you have ever been able to render the content you will have a remembered value for the size, and you'll use that instead. 

The [spec here](https://w3c.github.io/csswg-drafts/css-sizing-4/#valdef-contain-intrinsic-width-auto-length) does not appear to say that.

The first part implies it:

> `auto` [`<length>`](https://w3c.github.io/csswg-drafts/css-values-4/#length-value)
If the element has a [last remembered size](https://w3c.github.io/csswg-drafts/css-sizing-4/#last-remembered) and is currently [skipping its contents](https://w3c.github.io/csswg-drafts/css-contain-2/#skips-its-contents), its [explicit intrinsic inner size](https://w3c.github.io/csswg-drafts/css-sizing-4/#explicit-intrinsic-inner-size) is the last remembered size.

>
> Note: This occurs, for example, when an element with [content-visibility: auto](https://w3c.github.io/csswg-drafts/css-contain-2/#propdef-content-visibility) is off-screen.

My interpretation of that is that you use the remembered value when you are offscreen and have a remembered value and have `auto` set. That makes sense - you're using a remembered value because you can't recalculate one.

But then the spec says:

> Otherwise, its [explicit intrinsic inner size](https://w3c.github.io/csswg-drafts/css-sizing-4/#explicit-intrinsic-inner-size) is the specified [`<length>`](https://w3c.github.io/csswg-drafts/css-values-4/#length-value).

That "otherwise" is all other cases. To me that means that if you are not skipping the contents you will use length. I suspect in most cases you won't be using size containment, but if you are, this means you aren't using the remembered value even if you could. 

---

As an aside, the following paragraph reads as gibberish:

> If an element has an [explicit intrinsic inner size](https://w3c.github.io/csswg-drafts/css-sizing-4/#explicit-intrinsic-inner-size) in an axis, then after laying out the element as normal for [size containment](https://w3c.github.io/csswg-drafts/css-contain-2/#size-containment), the size of the contents in that axis are instead treated as being the explicit intrinsic inner size instead of what was calculated in layout, and layout is performed again if necessary. (If it has an explicit intrinsic inner size in both axises, this implies the first layout can be skipped.)

I may just be completely missing the point but "after laying out the element as normal for [size containment](https://w3c.github.io/csswg-drafts/css-contain-2/#size-containment)"  should means that there is nothing calculated in the layout.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7769 using your GitHub account


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

Received on Tuesday, 20 September 2022 05:04:20 UTC