Closed
Description
This problem was introduced in axe-core 4.5. When an element is scrolled out of view, it is not included in the grid, which results (among other things) that it is reported as incomplete once its scrolled out of view.
Here's how to reproduce the problem. These logs should report the same, but the second one reports incomplete instead of a violations.
<h1 style="color: #ABC">Hello World</h1>
<main style="background: #CDF; height: 800px;"></main>
<script src="/axe.js"></script>
<script>
window.onload = async () => {
window.scrollTo(0, 0);
const res0 = await axe.run({ runOnly: 'color-contrast' })
console.log({ violations: res0.violations, incomplete: res0.incomplete })
window.scrollTo(0, 1000);
const res1 = await axe.run({ runOnly: 'color-contrast' })
console.log({ violations: res1.violations, incomplete: res1.incomplete })
}
</script>
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
dbjorge commentedon Nov 8, 2022
In case it helps with prioritization/sense of scale of the issue: We were just doing some validation of axe-core 4.5.0 in preparation for upgrading Accessibility Insights for Web and found that 4.5.0 detected about 90% fewer color-contrast issues in our big corpus of test sites compared to 4.4.1 (78 vs 836 issues detected). Based on spot checking the cases with different results I suspect this is probably the root cause, but I didn't verify every case.
straker commentedon Nov 17, 2022
@dbjorge axe-core 4.5.2 was released and should fix this issue. Would you be able to pull it down and test it to see if it returns results as expected?
dbjorge commentedon Nov 18, 2022
Yes, I'll rerun with 4.5.2 against our big batch of test sites overnight tonight!
dbjorge commentedon Nov 19, 2022
Yes, that resolved most of the differences.
I did find one class of failure that was reported in 4.4.1 but still not in 4.5.2. It involves a specific type of carousel control currently used in a few Skype marketing pages. An example is the bottom of the main content in https://www.skype.com/en/content-creators/ (I tried to make a more minimal repro but gave up after 5 minutes). This specific control has a few reported
color-contrast
issues where it renders some carousel items atopacity: .2
as they transition onto the page.axe-core
4.4.1 and 4.5.2 both report those cases for which the content is visible on screen in this state ascolor-contrast
failures. However, 4.4.1 additionally reports the items which are completely off-screen in this state as having color-contrast failures, where 4.5.2 does not report color-contrast failures for the off-screen items.I think it'd be pretty questionable to call this case an axe-core bug - the content in question is completely off-screen inside a container which uses
overflow: visible
styling which suppresses the browser's default scrolling behavior, and I don't think it's reasonable to expect axe-core to infer whether there's some custom means of scrolling the elements into view (as the carousel buttons provide in this case). If anything, I think the 4.5.2 behavior of not reporting contrast issues with these specific off-screen elements is probably more reasonable than the 4.4.1 behavior.WilcoFiers commentedon Nov 21, 2022
@dbjorge this is expected. @straker made a number of improvement that allowed us to better detect when things are off screen / clipped. It sounds like that's what's going on here.
padmavemulapati commentedon Nov 23, 2022
Still seeing the issue, even when validated with the latest axe-core develop branch code base,
attaching the screen recording here,
Screen.Recording.2022-11-23.at.4.54.29.PM.mov
@straker , can you please provide your observations here on this
padmavemulapati commentedon Dec 5, 2022
Validated with the latest code base of axe-core develop branch,
test-snippet:
even after scrolled,
color-contrast
rule failing in this situation, which is expected