[csswg-drafts] [css-values-4] `<integer>` grammar terms and `<number>`-returning functions (#11040)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values-4] `<integer>` grammar terms and `<number>`-returning functions ==
Grammars can specify that they take either a `<number>`, or specifically an `<integer>`. This behavior is well-defined for literal tokens, but less clear for functions evaluating to these types.

Math functions that resolve to a `<number>` are defined to be allowed to satisfy an `<integer>` production; their value is rounded to the nearest integer. Similarly, interpolation between two `<integer>` terms is defined to round to the nearest integer. But there's not actually anything saying, one way or the other, how to treat *other* functions that return a `<number>` but aren't math functions, like `sibling-index()`. We have never defined a function as returning an `<integer>`; are these functions simply invalid to be used in `z-index` and the like?

I propose that we adopt the "round to the nearest integer" behavior for *everything* that's not a literal `<number-token>`. (The behavior for `<number-token>` is probably too entrenched to change.)

Agenda+ as this is a change to a stable spec.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11040 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 15 October 2024 20:48:28 UTC