[csswg-drafts] [css-values-5][css-property-values-api-1] Case-sensitivity of identifiers from `<syntax>` (#11124)

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

== [css-values-5][css-property-values-api-1] Case-sensitivity of identifiers from `<syntax>` ==
In this issue, I use `@property/initial-value` as an exemple and assume that it will be defined with `<syntax>` at some point, because `<syntax>` is otherwise only used in features that are not yet implemented in any browser.

```css
@property --registered {
  inherits: false;
  initial-value: RED;
  syntax: red;
}
```

The above code results to an invalid rule in current version of Chrome and FF (at least).

  > The [initial-value](https://drafts.css-houdini.org/css-properties-values-api-1/#descdef-property-initial-value) descriptor’s value must [parse](https://drafts.css-houdini.org/css-properties-values-api-1/#consume-a-syntax-definition) successfully according to the grammar specified by the syntax definition.

**Aside:** *"parse"* links to an incorrect algo, as reported in w3c/css-houdini-drafts#1111, if I am not mistaken.

However, this code results to a valid custom property value:

```css
@property --registered {
  inherits: false;
  initial-value: red;
  syntax: red;
}
div {
  --registered: RED;
}
```

Similarly, the new [parse with a syntax](https://drafts.csswg.org/css-values-5/#parse-with-a-syntax) algo is not quite clear on case-sensitivity:

  > 3. parse `values` according to `syntax`

Should it parse `values` case-insensitively, with the serialization of `<syntax>`, or against a grammar defined with enforced case-sensitivy because `<syntax>` produces `<[custom-]ident>`?

In hindsight, authors may or may not want case-sensitivite matching. For exemple, they might want case-sensitivity for `animation-name`s, but case-insensitivity for color names.

Perhaps `@property/case-sensitive` defined as `true | false` (initial: `true`) may be a solution to clarify the expected behavior?

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


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

Received on Thursday, 31 October 2024 14:47:53 UTC