Bug 221873
| Summary: | Add experimental support for CSS Color 5 color transformations | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | darin, koivisto, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 221880, 222258 | ||
| Bug Blocks: | |||
Sam Weinig
Now that we have adequate support for static color types and CSS Color 4, we should look at adding experimental support for the color transformation functions and syntax of CSS Color 5 - https://drafts.csswg.org/css-color-5/.
From doing an initial look, I have spotted a few initial things that we will need to consider:
- How should we handle transformations of color keywords that are currently not resolved until something like colorFromPrimitiveValue is called? The most basic example would be doing something like `color-mix(lch currentColor 40%, red)`. My hunch is we will want to create a new CSSValue type to store these pending-colors (perhaps limited only to the cases we can't do them eagerly).
- How can we inject constants into the environment for calc()? For the relative color syntax, the spec seems to want injection of named constants into css calc() functions. For instance, one example includes the following:
`color: hsl(from var(--accent) calc(h+180) s l);`
In this example, the "h" should be numeric value of the hue channel of var(--accent) converted to HSL. We will have to see what the best way to model this in the current CSS calc infrastructure is.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/74562173>
Sam Weinig
This is now complete.