alfa icon indicating copy to clipboard operation
alfa copied to clipboard

r69 reports subminimum contrast of elements with sufficient contrast

Open poolcvs opened this issue 1 year ago • 2 comments

On https://www.caremark.com/ r69 reports 36 failures, but at least some of the reported elements have sufficient contrast. The first reported failure is the SPAN containing “Worried about drug shortages?”, which has color #fff on background #c00. The fourth reported failure is an H2 containing “Getting your medication”, which has color #000 on background #f5f5f5. This second example also passes AAA, but fails r66.

poolcvs avatar Feb 24 '24 17:02 poolcvs

Thanks for the report 🤔 when running the extension (currently with Alfa version 0.67.0), I only see 11 errors for R66 (1.4.6) and none for R69, and for the "Worried about drug shortage?" text, Alfa correctly gets the #fff and #c00 colors. When running directly Alfa locally (version 0.74.0 plus some extra changes), I get similar results (no R69 error flagged).

Which version of Alfa are you running?

You can also investigate in more details with something like

const outcomes = Audit.of(…);

const target = Sequence.from(outcomes)
   .find(outcome => outcome.uri === 'https://alfa.siteimprove.com/rules/sia-r69' && 
                    outcome.target.data.includes("Worried about drug shortages?");

console.dir(target.toJSON(), {depth: null });

This should show you the foreground and background colors found by Alfa (in RGB percentages) which you can compare to the actual values.

Jym77 avatar Feb 26 '24 09:02 Jym77

The version of alfa-playwright is 0.64.8, but its dependencies have version 0.74.0. Thank you for the suggestion for investigation. I shall try that. However, I now notice that these reports are classified as cantTell, not as failures.

poolcvs avatar Feb 26 '24 16:02 poolcvs