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

Re: [csswg-drafts] [css-values-4] Should simplification of Sum nodes convert to canonical units? (#4505)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Fri, 15 Nov 2019 21:18:20 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-554532099-1573852698-sysbot+gh@w3.org>
> So following the steps, I'm not sure how calc(1rad + 45deg) gets reduced down to 102.29578deg.

That's triggered by step 3, where you simplify all the children of the node; `1rad` and `45deg` then hit step 1.2 and return themselves converted to `deg`. Then, back in simplifying the Sum node, step 7.2 sees that it has two `deg` children and combines them.

> There's also some ambiguity about whether the function name is preserved on the root if it simplifies down to a numerical value. Should calc(1px) simplify to 1px, and min(1px) to 1px? I think the combination of 10.7 step 6 and 10.7.1 step 4 suggest that they do, but browsers don't seem to implement that.

It's definitely not clear, and I'm not sure what's ideal, actually! That's why I opened <https://github.com/w3c/csswg-drafts/issues/4399> to talk about it. ^_^ I'll move your questions/examples over to that issue, and since the original question from this issue has been answered, I'll close this one.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4505#issuecomment-554532099 using your GitHub account
Received on Friday, 15 November 2019 21:18:21 UTC

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