[css‑syntax] `<string‑token>` should probably handle valid surrogate pairs
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Spec: https://drafts.csswg.org/css-syntax-3/#consume-string-token
The 6 digit syntax for <string‑token> was only added to CSS in CSS2, with the CSS Syntax module restricting it to not allow surrogate code points, but I would expect that a string containing valid surrogate pairs would work like the equivalent 6 digit syntax, e.g.:
.foo:before {
/*
The "CSS1" and "CSS2.1" specifications parse this as:
- U+D83D (High Surrogate)
- U+DD25 (Low Surrogate)
The "CSS Syntax Level 3" specification parses this as:
- U+FFFD (Replacement Character)
- U+FFFD (Replacement Character)
I would expect this to parse as the U+D83D and U+DD25 surrogate code points,
which would decode to U+1F525 (Fire) at parse time.
*/
content: "\D83D\DD25";
}
and
.foo:before {
/*
The "CSS1" specification parses this as:
- U+1F52 (Greek Small Letter Upsilon With Psili And Varia)
- U+35 (Digit Five)
The "CSS2.1" and "CSS Syntax Level 3" specifications parse this as:
- U+1F525 (Fire)
*/
content: "\1F525";
}
would be equivalent.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked CSS Syntax Level 3 section on consuming string tokens and compare its treatment of surrogate code points with the examples in the issue. The issue asks whether valid surrogate pairs should be handled differently; done would require a resolved specification decision and any corresponding draft change, but no implementation files or tests are named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100