Description
Product
axe-core
Product Version
v4.6
Latest Version
- I have tested the issue with the latest version of the product
Issue Description
Expectation
When running color-contrast checks with forced-colors
active
, the colors used in the contrast calculation should be the colors presented with forced-colors
.
Actual
The foreground color is calculated from the non-forced color and the background is calculated from the forced color.
How to Reproduce
I don't think one will be needed, but I can try to come up with one if needed.
Additional context
In this commit, get-foreground-color was changed to use -webkit-text-fill-color
rather than color
. This property is unchanged when forced-colors
is active
. The background, however, is still using the background-color
property which does change when forced-colors
is active
.
This introduced a regression to my company's use of axe-core running color-contrast
when forced-colors
is active
since it now uses a mix-and-match of forced and non-forced color values. I think it's probably unintended to mix-and-match, but I'm curious if axe-core even intends to support running color-contrast
with forced-colors
active
.