Skip to content

[css-images-4] is serialization from named colors to rgb values is mandatory in general #7728

@karlcow

Description

@karlcow

Hello,

https://drafts.csswg.org/css-images-4/#serialization

says:

This section describes the serialization of all new properties and value types introduced in this specification, for the purpose of interfacing with the CSS Object Model [CSSOM].

In https://drafts.csswg.org/css-color-4/#serializing-color-values

It says:

This section updates and replaces that part of CSS Object Model, section Serializing CSS Values, which relates to serializing values.

And then later on

The serialized form of the following sRGB values:
hex colors
rgb() and rgba() values
hsl() and hsla() values
hwb() values
named colors
system colors
deprecated-colors
is derived from the computed value and thus, uses either the rgb() or rgba() form (depending on whether the alpha is exactly 1, or not), with lowercase letters for the function name.

but the example given in gradient shows:

Linear-Gradient( to bottom, red 0%,yellow,black 100px)

is serialized as

linear-gradient(red, yellow, black 100px)

Is it just a typo, where the named colors should have been converted to RGB values. Or am I just reading too much?

This is partially raised because some tests are being changed to follow this.
web-platform-tests/wpt#35864

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