[csswg-drafts] [cssom] Always return escaped idents? (#12258)

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

== [cssom] Always return escaped idents? ==
When some some CSS construct holds a name of some kind, and a CSSOM API makes it possible to read that name back to JS, should we return a serialized ident, or the actual internal value?

Using the name `a\9 b` (U+0009 => TAB) I checked [a number of at-rules](https://jsbin.com/rolumomodu/edit?html,output) that expose their name in some way, and the result varies from rule to rule and from browser to browser. It doesn't appear to be consistently specified in one way either.

Chrome:

```
@layer (statement): a\9 b
@layer (block): a\9 b
@container: a\9 b
@property: --a b
@position-try: --a b
@keyframes: a b
@font-palette-values: --a b
@font-feature-values: "a\9 b"
```

Firefox:

```
@layer (statement): a\9 b
@layer (block): a\9 b
@container: a\9 b
@property: --a b
@position-try: (N/A)
@keyframes: a b
@font-palette-values: --a\9 b
@font-feature-values: a\9 b
```

Safari:

```
@layer (statement): a\9 b
@layer (block): a\9 b
@container: a\9 b
@property: --a b
@position-try: (N/A)
@keyframes: a b
@font-palette-values: --a b
@font-feature-values: a b
```

We should establish a guideline here, so that we don't continue to just arbitrarily pick something when adding new rules. I'm not sure what's best.

cc @emilio , @cdoublev 

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


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

Received on Monday, 2 June 2025 10:30:39 UTC