W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2019

Re: [csswg-drafts] [css-values] Actually describe how/whether computed math functions are simplified from specified ones (#2245)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Sun, 06 Oct 2019 05:55:34 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-538714737-1570341333-sysbot+gh@w3.org>
> IIUC we shouldn't resolve % in at & before computed time. However, at least in some cases, we already have that information at computed time (e.g., when the parent element has a fixed width).

Some %s should be resolved at computed-value time.  'width' isn't one of those, because layout hasn't been done yet. This wording shouldn't be less specific than the old wording, which was:

> Where percentages are not resolved at computed-value time, they are not resolved in math functions, e.g. calc(100% - 100% + 1px) resolves to calc(0% + 1px), not to 1px. If there are special rules for computing percentages in a value (e.g. the height property), they apply whenever a math function contains percentages.

(Note to myself: I could probably carry over some of the wording of that last sentence. That's not relevant to what you are asking, tho.)

> For min/max/clamp(%), this seems to have something to do with #4227. Or we probably need to be more specific about "enough information" again.

No, it's independent of that; how #4227 is resolved will affect this (by defining when the comparison is allowed to be resolved), but this doesn't affect #4227.

> One last thought, it's probably better to add some examples or notes. As this version is less declarative than the previous one, it's harder to figure out the expected result without following the algorithm step-by-step. Can we add some notes for some simple/common cases? For example, when there's no non-calc math functions (which I believe is the most common case), the result is a summation of numeric values of different units that can't be further merged.

Yup, I need to add more examples of the new stuff, indeed.

And yes, when you limit the input to what was allowed before we added unit algebra and math functions, the intention is that this *should* produce a sum of unmergeable numeric values.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2245#issuecomment-538714737 using your GitHub account
Received on Sunday, 6 October 2019 05:55:36 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:54 UTC