- From: cathiechen via GitHub <sysbot+gh@w3.org>
- Date: Wed, 06 Jul 2022 15:31:54 +0000
- To: public-css-archive@w3.org
cathiechen has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-sizing-4] The priority of different minimum and maximum sizes ==
Now, we have different kinds of minimum/maximum sizes:
* The Definite minimum/maximum sizes
* [Transferred Min/Max Sizes](https://drafts.csswg.org/css-sizing-4/#aspect-ratio-size-transfers)
* [Automatic Content-based Minimum Sizes](https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum)
1. Per [1], the "Definite minimum/maximum sizes" has higher priority than the "Automatic Content-based Minimum Sizes".
```
<!DOCTYPE html>
<style>
#target {
background: green;
height: 100px;
aspect-ratio: 1 / 1;
max-width: 30px;
}
</style>
<div id="target">
<div style="width:200px;"></div>
</div>
```
The definite maximum width is 30px, the Automatic Content-based Minimum width is 200px, so the calculated width of target should be 30px, IIUC.
Tested in Chromium, WebKit and Gecko, the calculated width of target is 30px. I think we need a test for it if we have an agreement here.
2. Per [2], the "Definite minimum/maximum sizes" has higher priority than the "Transferred Min/Max Sizes".
```
<!DOCTYPE html>
<style>
#target {
background: green;
height: 100px;
aspect-ratio: 1 / 1;
max-height: 50px;
max-width: 30px;
}
</style>
<div id="target"></div>
```
The "Definite maximum width" is 30px, the "Transferred Max width" is 50px, so the width of target should be 30px.
WebKit is 50px, Chromium and Gecko is 30px. Need a WPT test for it here.
3. It seems we have not defined the priority of "Transferred Min/Max Sizes" and "Automatic Content-based Minimum Sizes" explicitly.
```
<!DOCTYPE html>
<style>
#target {
background: green;
height: 100px;
aspect-ratio: 1 / 1;
max-height: 30px;
}
</style>
<div id="target">
<div style="width:200px;"></div>
</div>
```
The "Transferred Max width" is 30px, and the "Automatic Content-based Minimum width" is 200px.
The behavior of the engines are consistent, all are 200px.
I do not have a strong opinion here, if the agreement is 200px, need a WPT test for it.
[1] https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum
[2] https://drafts.csswg.org/css-sizing-4/#aspect-ratio-size-transfers
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7461 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 6 July 2022 15:31:57 UTC