Skip to content

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

@AtkinsSJ

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions