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

Re: [csswg-drafts] [mediaqueries] How do media queries with calc() where it can be resolved early serialize? (#1968)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Thu, 03 Oct 2019 23:39:57 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-538169678-1570145995-sysbot+gh@w3.org>
The spec is now clear that math functions are simplified immediately at parse time as much as possible, then again at computed/used value time (which isn't relevant for MQs).

Since MQs can convert all units to their canonical one, this means that all math functions in MQs should be resolvable immediately upon parsing.

Serialization is clear that fully-collapsed calc()s only serialize as their argument (without the `calc()` wrapper) if you're serializing a computed-time or later value. MQs are not computed or later, so they should never remove their calc() wrapper.

Note that, as currently specified, non-calc() math functions do not disappear if they're top-level even if they can be fully resolved; they retain their identify as the specific function and simplify their arguments. So a `sin(.5)` will serialize as such, not as `.479...`.

Since this should all be answered in the spec, I'm closing this issue. Feel free to reopen if there are any issues or confusing bits.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1968#issuecomment-538169678 using your GitHub account
Received on Thursday, 3 October 2019 23:39:58 UTC

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