Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-values-5][css-property-values-api-1] Case-sensitivity of identifiers from <syntax> #11124

Open
cdoublev opened this issue Oct 31, 2024 · 0 comments

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Oct 31, 2024

In this issue, I use @property/syntax as an example 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.

@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 descriptor’s value must parse 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:

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

Similarly, the new parse with a syntax algo is not quite clear on case-sensitivity:

  1. 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 example, they might want case-sensitivity for animation-names, but case-insensitivity for color names.

Perhaps @property/case-sensitive defined as true | false (initial: true) may be a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant