- From: Tab Atkins Jr. via GitHub <noreply@w3.org>
- Date: Tue, 02 Jun 2026 20:05:37 +0000
- To: public-css-archive@w3.org
They are indeed not math functions, for the reasons explained in #11204, yeah. A function is defined as a math function if it, well, does math on values and needs to inherit the [calculation context](https://drafts.csswg.org/css-values-4/#calc-context) from where it's used. Sibling count/index don't do this, they're just functions that return numbers. @cdoublev points out the reason why the `calc()` wrapper should be maintained - if the context it's used in has a limited range, a `calc(N)` outside that range gets clamped to the allowed range, and a `calc(sibling-index())` should do the same. Dropping the calc() loses us that ability. But also as Guillaume points out, the *integer-rounding* behavior of math functions has already been extended in general to number-returning functions, and I think it would be reasonable to also extend the clamping, for the same reason that math functions clamp. (You can't check the range at parse time, and we don't want to have to define special error behavior just for dynamic functions that can't be triggered by hand.) So yeah, Agenda+ for two simple resolutions: * Extend the resolution from #11040 (all number-returning functions round to `<integer>` when needed) to also cover range-clamping. * Modify calculation serialization to drop the calc() wrapper if the top-level node is just a lone number-returning function, now that the previous resolution makes the wrapper unnecessary. -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13978#issuecomment-4606578252 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 2 June 2026 20:05:38 UTC