- From: Ian Kilpatrick via GitHub <noreply@w3.org>
- Date: Tue, 23 Sep 2025 19:54:17 +0000
- To: public-css-archive@w3.org
We should apply an understandable, and consistent rule - and I agree its kinda a mess at the moment with "new" features being applied on top of the old css2 rule. My preference here would be to allow margin-collapsing if the final resolved size is different from the intrinsic-size (with the intrinsic-size **not** including end margins). We implement this logic here: https://chromium-review.googlesource.com/c/chromium/src/+/6976917/1/third_party/blink/renderer/core/layout/block_layout_algorithm.cc#b1378 Today we don't allow margin collapsing to occur if we have resolve "height" without an intrinsic size. E.g. you'll get the same behaviour for `height:auto`, `height:max-content`, `height: calc-size(auto, size)`, etc. This also explains our behaviour with `max-height:max-content` etc. The reason I'd like to change (assuming web compatible) to just comparing the final height to the intrinsic-size (w/o margins) is its now possible to have things like: `height: calc-size(auto, min(size, 100px))` and similar. (With that change applied we'd render your testcase like: <img width="152" height="87" alt="Image" src="https://github.com/user-attachments/assets/2feb63e7-a55d-4281-bf0a-ca3a4fc7936a" /> ) -- GitHub Notification of comment by bfgeek Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12218#issuecomment-3325341779 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 23 September 2025 19:54:18 UTC