Skip to content

[css-color] Eager evaluation of calc() for specified value serialization of non-rgb() colors #10830

@weinig

Description

@weinig

The CSS Color 4 spec currently only requires eager evaluation of calc() for rgb colors:

For historical reasons, when calc() in sRGB colors resolves to a single value, the declared value serialises without the "calc(" ")" wrapper.

This leaves all the other color types without this behavior, but currently, WPT seems to contradict that. For example, in the test for specified value serialization of lab(), the following test has this expectation [input, expected serialization]:

    ["lab(calc(50 * 3) calc(0.5 - 1) calc(1.5) / calc(-0.5 + 1))", "lab(100 -0.5 1.5 / 0.5)"],

I think the spec makes sense, and is consistent with most other CSS properties, but before changing the tests, I wanted to verify my understanding was correct.

@svgeesus @LeaVerou

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