W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2021

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

From: Daniel Holbert via GitHub <sysbot+gh@w3.org>
Date: Tue, 03 Aug 2021 00:02:07 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-891410062-1627948926-sysbot+gh@w3.org>
I'm confused about the definition of "cyclic percentage" here (and whether or not it's affected by the CB having a specified size).  This is relevant because TYLin (@aethanyc ) has a proposed patch on https://bugzilla.mozilla.org/show_bug.cgi?id=1700474 to change Firefox's behavior to match Chrome, but I think it may represent a step away from spec-conformance.

My point of confusion is: **does a percentage become non-cyclic just because the containing block has a definite size in the same axis?**
Tab and fantasai have comments here indicating "yes" (see below), but I'm not sure the spec's definition agrees (see further below).

Quoting Tab implying "yes":
> [...] the stuff in Sizing section 5.2.1 applies. But that only affects cyclic percentages, which don't appear in any of the testcases here, since in all these examples the container has a definite width and so the % is definite, not cyclic.

Quoting fantasai implying "yes":
> * I think the testcase you gave should have both of those images resolve the same way because in both cases is the width is definite. If it's Web-compatible and reasonably implementable, that would be my preference. It's the cases where a percentage is being resolved against an indefinite size (i.e. is cyclic) that we need to treat it as a zero-based clamp on the intrinsic size contribution / automatic minimum size. This case isn't cyclic, so we should resolve the percentage and use the resulting length.

But my intuition (which leans "no") is that intrinsic sizes (e.g. an element's min-content contribution & min-content size) are not meant to be impacted by things external to the element like the size of it's containing block.  And I think the spec agrees with me...

Quoting the spec implying "no" (css-sizing-3 5.2.1), emphasis added:
> "a **percentage value that resolves against a size in the same axis as the intrinsic size contribution** (a **cyclic percentage size**)".

Note that there's no caveat for "but only if the containing block's size is indefinite" here, or anything like that...

So: I think that means the percent sizes in the testcases here *are* in fact "cyclic", right? (for the purposes of calculating the intrinsic size contribution & automatic minimum size, per 5.2.1)

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 3 August 2021 00:02:09 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:47 UTC