Skip to content

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

@cdoublev

Description

@cdoublev

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions