False color-contrast violations on elements with the clip or opacity styles #1987
Labels
color contrast
Color contrast issues
fix
Bug fixes
rules
Issue or false result from an axe-core rule
Milestone
Summary
#1943 appears to have introduced a false
color-contrast
violation under either of the following conditions:Scenario 1:
ElementB is displayed on top of ElementA but ElementB is completely clipped (
clip: rect(1px, 1px, 1px, 1px);
) so that it is not visible on the page. All that is visible is ElementA.To see the test page:
clip
style to show/hide ElementB.Axe detects the following color-contrast violation even when ElementB is completely clipped/invisible. It appears that axe uses the text color of elementA with the background-color of elementB to determine the color-contrast (both are dark colors).
Scenario 2:
Element has a background-color of
#ffffff
(white) and a text color of#1c1f21
(black) with an opacity of0.2
. These style combined makes the text color appear light gray with a white background.Go here to see the actual page
With the changes on #1943 axe now detects the following color-contrast violation. It appears that it now applies the opacity when determine the color contrast.
cc/ @straker
The text was updated successfully, but these errors were encountered: