Regression: Contrast elements list unconsistent depending on the platform
Product
axe-core
Product Version
4.8.0
Latest Version
- [X] I have tested the issue with the latest version of the product
Issue Description
Hi,
The Contrast 'Failing Elements' reported list is smaller when using linux than when using windows. It seems that Unicode string are not well handled on axe-core when using linux platform.
- This happens with Lighthouse 10.1.0 to 10.4.0 (tested with axe-core 4.8.0; was failing on error on 4.7.2)
- It was working fine on both systems with Lighthouse 9.3.0 (axe-core 4.3.5)
Seen on https://www.maybelline.com.hk/zh-hk/eye
Attached 3 test files with the different behaviors about this issue test reports.zip
++ tested on docker linux using lighthouse CLI with mobile rendering
Thanks
Thanks for the issue. I'll take a closer look at this next week.
Hi Did you had a chance to look at this issue ? Thanks
Oh right, thanks for the reminder. A lot has come up recently so I lost track of this.
Do you know if this issue is related to https://github.com/dequelabs/axe-core/issues/4155#issuecomment-1719563420? Is it just Lighthouse that has the issue and thus is a mobile view only issue? I tried testing a few different runs on my Mac using Chrome in Mobile view, but the results were pretty much consistent. There was 1 difference sometimes with target-spacing rule but it was only in the passes section that there was one extra node included sometimes.
Hi Straker,
Testing with https://www.maybelline.com.hk/zh-hk/face
- On Mobile headless under Linux docker, with LH 10.4 and "axe-core":"4.8.0"
- On Mobile headless under Linux docker, with LH 9.3.0 and "axe-core":"4.3.5" we have a lot more of 'failing contrast elements ' reported
- On this link (https://www.maybelline.com.hk/zh-hk/face/fitme/fitme-concealer) the contrast issue is reported only when using the "axe-core":"4.3.5" version
- Also tested using same configuration but with deviceMode=desktop and I see the same issue. Basically these ones are not reported on the new version
Hope this helps :)
Interesting. So on Mac when I run the two pages you provided I get all the same number of Violations between axe 4.3.5 and 4.8.2, and the buttons all produce one. The button-primary class defines a color and background-color that is not 4.5:1 compliant (it is 3.79:1).
.button-primary {
color: #fff;
background-color: #f92a63;
border-color: transparent;
}
I'm not sure why on different platforms that combination would produce a different result. Could you expand your results to see what it thinks the colors are? The message should list all the different things that contribute to the contrast (foreground color, background color, font size, weight, etc.). My only guess is that if the font-size were bigger in some scenarios the calculation would use large text size which only requires 3:1, which would pass.
Wait, I just noticed that on your screenshots there are no Chinese text characters showing on the buttons. Could it be that the Linux docker image is unable to display Chinese characters? If so that might explain what's going on. Axe-core is doing a better job of filtering out things without visible text to run through color-contrast, so if there is no text in the button then the 4.8.2 version of axe-core would probably skip over those buttons.
Nice finding, I added the font-noto-cjk to the container and have now the same behavior as the axe-core previous version (except that the missing Chinese text is now visible in the buttons)
Oh nice. Does that mean we can close this issue?
Yes, sure, thanks for your help