Skip to content

[css-typed-om] Unclear how to get the source string when multiple CSSStyleValues are created from USVString #1156

Open

Description

@AtkinsSJ

The serialization for CSSStyleValue says:

if the value was constructed from a USVString
the serialization is the USVString from which the value was constructed.

The trouble is, that a single USVString can produce multiple CSSStyleValues. As far as I can tell, all paths go through "parse a CSSStyleValue", which parses the string as a list of CSSStyleValues, optionally returning just the first one. The source string then wouldn't correspond to one CSSStyleValue, but only part of it would.

For example:

// parse() means we only get the first value
var cool = CSSStringValue.parse("background", "url('cool.png'), url('rad.png')");

// Source string is "url('cool.png'), url('rad.png')" but this should only log "url('cool.png')".
console.log(cool.toString());

Activity

  1. changed the title [-][css-typed-om] Unclear how[/-] [+][css-typed-om] Unclear how to get the source string when multiple CSSStyleValues are created from USVString[/+] on Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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