Bug 211933 - CSS color function should allow fallback color
Summary: CSS color function should allow fallback color
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: 211931
  Show dependency treegraph
 
Reported: 2020-05-14 16:26 PDT by Nikita Vasilyev
Modified: 2022-02-10 16:04 PST (History)
10 users (show)

See Also:


Attachments
[Patch] WIP (15.54 KB, patch)
2020-05-15 00:48 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2020-05-14 16:26:54 PDT
color: color(display-p3 1 0 0, green)

This should show red when display-p3 is supported, and green when it isn't. Instead it shows black.

data:text/html;,<body%20style="color:color(display-p3%200%201%200,%20green)">color</body>

---

https://www.w3.org/TR/css-color-4/#color-function

10.1. Specifying profiled colors: the color() function

The color() function allows a color to be specified in a particular colorspace (rather than the implicit sRGB colorspace that the other color functions operate in). Its syntax is:

color() = color( [ <ident>? [ <number>+ | <string> ] [ / <alpha-value> ]? ]# , <color>? )
The color function takes one or more comma-separated arguments, with each argument specifying a color, and later colors acting as "fallback" if an earlier color can’t be displayed (for example, if the colorspace it specifies hasn’t been loaded yet).
Comment 1 Radar WebKit Bug Importer 2020-05-14 16:28:43 PDT
<rdar://problem/63248585>
Comment 2 Devin Rousso 2020-05-15 00:48:21 PDT
Created attachment 399462 [details]
[Patch] WIP

Needs tests, but I think I have it working :)
Comment 3 Sam Weinig 2022-02-10 16:04:36 PST
Fallback colors have been removed from the spec.