[csswg-drafts] [css-sizing][css-contain] Are intrinsic sizing keywords definite with size containment? (#7206)

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

== [css-sizing][css-contain] Are intrinsic sizing keywords definite with size containment? ==
https://andreubotella.com/csswg-auto-build/css-sizing-3/#definite

> A size that can be determined without performing layout

So if I have something like

```html
<div style="height: auto; contain: size; border: solid">
  <div style="height: 50%; background: cyan;">a</div>
</div>
<br><br>
<div style="height: auto; contain: size; contain-intrinsic-size: 100px; border: solid">
  <div style="height: 50%; background: cyan;">a</div>
</div>
```

Should the inner elements resolve `50%` to `0px` and `50px`?

Browsers seem to treat the percentage as [cyclic](https://andreubotella.com/csswg-auto-build/css-sizing-3/#cyclic-percentage-size) so it behaves as `auto`, i.e. they don't consider the parent's `height: auto` as definite. But we can determine the size without performing layout.

https://andreubotella.com/csswg-auto-build/css-contain-2/#sizing-as-if-empty

> The [used](https://andreubotella.com/csswg-auto-build/css-cascade-5/#used-value) [width](https://andreubotella.com/csswg-auto-build/css-sizing-3/#propdef-width) and [height](https://andreubotella.com/csswg-auto-build/css-sizing-3/#propdef-height) of the [containment box](https://andreubotella.com/csswg-auto-build/css-contain-2/#size-containment-box) are determined as if performing a normal layout of the box, except that it is treated as having no content

Does this mean that no content is marked as having a cyclic percentage?

https://andreubotella.com/csswg-auto-build/css-contain-2/#laying-out-in-place

> The [containment box](https://andreubotella.com/csswg-auto-build/css-contain-2/#size-containment-box)'s content (including any pseudo-elements) must then be laid out into the now fixed-size containment box normally.

Does "fixed-size" mean that it's definite?


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


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

Received on Friday, 8 April 2022 09:40:29 UTC