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

Re: [csswg-drafts] [css-values-4] What should non-calc() math functions serialize to when they're fully resolved? (#4399)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Wed, 20 Nov 2019 18:05:25 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-556185678-1574273124-sysbot+gh@w3.org>
So it looks like all browsers *do* canonicalize units at specified-value time; Chrome just has a quirk that it only canonicalizes if it has to combine disparate units: `calc(1in + 1in)` serializes to `calc(2in)`, but `calc(1in + 1cm)` serializes to `calc(133.795px)`. Firefox, I think, doesn't have that quirk, and eagerly canonicalizes everything. I don't know what Safari's behavior is.

So this is roughly in accord with the resolution, and the current spec, which aggressively canonicalizes and serializes as far as possible.

I'm going to add a note to the spec emphasizing that a calculation tree that's been reduced to a single numeric value is still a calculation tree, and serializes as such (thus hitting the serialization algo that wraps it in a `calc()` at specified-value time, but clamps and serializes it directly at computed/later time).

GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4399#issuecomment-556185678 using your GitHub account
Received on Wednesday, 20 November 2019 18:05:27 UTC

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