Skip to content

[css-color][css-values] Should calc(NaN) and calc(infinity) be serialized as part of the CSS colors #10424

@weinig

Description

@weinig

There are a few tests that require calc(NaN) and calc(infinity)/calc(-infinity) to be serialized as part of a color value.

For instance in css/css-color/parsing/color-valid-color-function.html:

    test_valid_value("color", `color(${colorSpace} 0 calc(infinity) 0)`, `color(${colorSpace} 0 calc(infinity) 0)`);

and

    test_valid_value("color", `color(${colorSpace} calc(NaN) 0 0)`, `color(${colorSpace} calc(NaN) 0 0)`);

From my reading of https://drafts.csswg.org/css-values/#calc-ieee, it seems like NaN and infinity should never "escape" top-level calculation, and should be censored to 0.

I am not entirely sure what "escape" means though, so I am not sure what is correct.

@tabatkins @fantasai , can one of you shed light on this?

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