Bug 211933

Summary: CSS color function should allow fallback color
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: CSSAssignee: Devin Rousso <hi>
Status: RESOLVED WONTFIX    
Severity: Normal CC: esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hi, jond, macpherson, menard, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 211931    
Attachments:
Description Flags
[Patch] WIP none

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.