Re: [csswg-drafts] [css-color] [css-color-adjust] Consider reversing the resolution of #3847 (#6773)

@emilio said:
> Can you explain what's going on here?

I don't believe that Chromium has shipped the system color computing to itself behavior, which is likely why you're seeing the behavior you are.

There is a part of the [Forced Colors Mode spec](https://drafts.csswg.org/css-color-adjust-1/#forced-colors-properties) that I think relies on the decision in #3847:

> if its computed value is a color other than a system color, its used value is instead forced to a system color

In other words, we force the colors at used value time, but do not force the color if it is a system color already. If system colors no longer compute to themselves, this won't be as clean to do (although in Chromium, we currently have a workaround for this, so we can continue to work around this if the decision is overturned).

> I think this is even more interesting for forced-color-adjust. preserve-parent-color seems relevant here?

Because `preserve-parent-color` forces the computed `color` to the parent's used `color` value, in general, it shouldn't matter if the system color computes to itself since we are only looking at the used value. But perhaps you are specifically referring to the interaction between system colors, `color-scheme` and `forced-color-adjust`, and that does seem pretty interesting.

In Chromium, we are currently ignoring `color-scheme` when resolving system colors in Forced Colors Mode, even if `forced-color-adjust` is `none`/`preserve-parent-color`. In other words, we always resolve the system colors to the OS defined system colors in Forced Colors Mode, no matter what `color-scheme` is set to (which may not be the expected behavior).

However, if we do take `color-scheme` into account, we could run into some pretty interesting use cases. For example:

```
<!doctype html>
<style>
  :root { color-scheme: dark; }
  span { forced-color-adjust: preserve-parent-color; color-scheme: light; }
</style>
I'm CanvasText in Forced Colors Mode <span>I should be light?</span>
```

In this case, the root's `colors-scheme` will be overridden to `light dark`. The span would set its `color` value to the used value of its parent (i.e. the resolved value of CanvasText), which may not match the expected light `color-scheme` of the span. We could run into similarly interesting cases with `forced-color-adjust: none`.

-- 
GitHub Notification of comment by alisonmaher
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6773#issuecomment-956399718 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 1 November 2021 16:49:02 UTC