Re: [csswg-drafts] [css-sizing] clarification around Compressible Replaced Elements and min-content size (#5665)

> * The min-content contribution of replaced elements to calculate _cyclic percentages only_ against zero. Non-cyclic percentage resolve against their containing block as normal.

Yes.

> * The min-content contribution of semi-replaced elements (INPUT etc.) to calculate _all percentages_ against zero, even if they could resolve against its definite containing block.

As observed via a flex item's specified size suggestion[1], Blink makes the min-content contribution of these semi-replaced elements 0 when they have a percent width, even if the percent width could resolve against its definite containing block.

However, the semi-replaced elements do not have a 0 min-content contribution when they have a percent max-width, even though [5.2.1c](https://drafts.csswg.org/css-sizing-3/#replaced-percentage-min-contribution) should apply to an element with % width or % max-width. Firefox 86 matched Blink wrt % max-width here, so we equally ignore that part of the spec 🤷

You asked about what we **need** for Web-compat reasons. I instead described what Blink does because I don't know that we **need** to stick with all of this behavior. Maybe some stuff could be changed with an acceptably small amount of compat pain? We don't have any data yet, but if we come up with some candidate changes, I can start gathering some data. But given @dholbert's research in https://github.com/w3c/csswg-drafts/issues/5665#issuecomment-742119407 about eliminating compressibility of flex items (which I'd hoped would be possible), I'd vote for just converging on Blink's behavior ☹️. I don't think we should expand compressibility to include elements with a % max-width, because that would cause some elements on existing pages to get size 0 and completely disappear, which is a severe failure mode.

[1] How would you [observe the min-content contribution](https://jsfiddle.net/dgrogan/ba6xL39w/15/) of an element with percent width whose containing block has a definite width? I could only think of flex or grid's automatic minimum size so that's what I used. Is there another way?

As for [IsContentMinimumInlineSizeZero](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/layout/ng/ng_block_node.cc;drc=dae60082cd2b983c227ca41e5d20c01fd5a99276;l=340), that function does hold the complete list of elements that Blink treats as compressible, at least in non-table contexts.

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


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

Received on Tuesday, 16 March 2021 07:00:26 UTC