The specification section for tree counting functions isn't explicit about these being math functions or not, other than by omission of the phrase "math function". Is there a definitive answer to whether they are math functions, and why not if they aren't? The behavior seems like it would be the same, other than one case: the serialization of calc(sibling-index()). That would simplify and serialize to sibling-index() as a math function, or remain as calc(sibling-index()) if it was a numeric value / leaf node. I don't believe there are tests disambiguating this currently.
It should be noted that Chrome and Safari both appear to treat these as math functions in their implementations, based on their serialization of calc(sibling-index()).
document.body.style.zIndex = 'calc(sibling-index())';
console.log(document.body.style.zIndex);
// "sibling-index()" in both Chrome and Safari
I'm working on the Firefox implementation for these functions and we're discussing whether to implement them as math functions or not. Implementing them as math functions appears to be simpler than adding support in calc trees and number/integer parsing, and matches Chrome and Safari, but appears to deviate from specification on that serialization case if it isn't a math function.
The specification section for tree counting functions isn't explicit about these being math functions or not, other than by omission of the phrase "math function". Is there a definitive answer to whether they are math functions, and why not if they aren't? The behavior seems like it would be the same, other than one case: the serialization of
calc(sibling-index()). That would simplify and serialize tosibling-index()as a math function, or remain ascalc(sibling-index())if it was a numeric value / leaf node. I don't believe there are tests disambiguating this currently.It should be noted that Chrome and Safari both appear to treat these as math functions in their implementations, based on their serialization of
calc(sibling-index()).I'm working on the Firefox implementation for these functions and we're discussing whether to implement them as math functions or not. Implementing them as math functions appears to be simpler than adding support in calc trees and number/integer parsing, and matches Chrome and Safari, but appears to deviate from specification on that serialization case if it isn't a math function.