- From: Guillaume via GitHub <sysbot+gh@w3.org>
- Date: Mon, 26 Dec 2022 08:42:44 +0000
- To: public-css-archive@w3.org
cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-values-4] Clarify maximum calculation terms ==
> UAs must support calculations of at least 32 `<calc-value>` terms and at least 32 levels of nesting (parentheses and/or functions)
Considering the above requirement, does `calc(calc(1 + 2) + calc(1))` include 2 or 3 `<calc-value>`s?
Assuming `<calc-value>`s should be counted like nesting levels (recursively), there are 3. But Chrome does not support more than 99 `<calc-value>`s whereas it supports 100 `<calc-value>`s split into two separate calculations:
```js
style.opacity = `calc(${[...Array(100)].reduce(n => `(${n})`, '1')})`
style.opacity; ''
style.opacity = `calc(${[...Array(50)].reduce(n => `(${n})`, '1')} + ${[...Array(50)].reduce(n => `(${n})`, '1')})`
style.opacity; 'calc(2)'
```
I would be fine with closing this issue as "question answered" with ***32 `<calc-value>`s without considering nesting***, because that is what it means to me in the absence of any other precision.
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8258 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 26 December 2022 08:42:46 UTC