[csswg-drafts] [css-values-4] Should `<percentage>` be invalid in calculations matching `<number>`? (#9661)

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

== [css-values-4] Should `<percentage>` be invalid in calculations matching `<number>`? ==
I suspect that [determining the type](https://drafts.csswg.org/css-values-4/#determine-the-type-of-a-calculation) of `<percentage>` should be a failure when the grammar does not accept `<percentage>`, instead of defaulting to `[percent: 1]`:

  - `calc(1% / 1%)` should be an valid `z-index` because its grammar only accept `<number>`
  - `calc(1% / 1% * 1px)` should be a valid `width` because its grammar accepts both `<length>` and `<percentage>`, which resolves to a `<length>` based on the width or height of the containing block

Note: I assume that the type of `calc(1% / 1%)` as a value for `z-index` is currently `[percent: 0]`, which [matches](https://drafts.css-houdini.org/css-typed-om-1/#cssnumericvalue-match) `<number>`.

Or am I missing something?

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


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

Received on Thursday, 30 November 2023 20:33:49 UTC