Repository navigation
test(a11y): check contrast a frame after the page's fades end - #330
Merged
Merged
Conversation
seriousViolations waited for the page's running animations to finish before axe ran. In Linux WebKit on a loaded runner, the event editor dialog's fade could already read `finished`, 104 to 173 ms into its 100 ms, while the page still showed an earlier frame at 0.53 to 0.95 opacity: WebKit reads an animation's time from the clock but puts its value on the page only in a frame. Nothing was running, so axe ran on the half-faded dialog and its backdrop. The wait now ends only after a frame with nothing running, by which time the end of the fade is on the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the WebKit "event editor dialog" failures in the release gate's
browsersstep (run 45726058412), at the cause, inseriousViolations' wait (tools/a11y/tests/axe.ts).The cause
Before axe runs,
seriousViolationswaits for the page's running animations to finish, so a fading popup can't fail contrast (#319). In Linux WebKit on a loaded runner, the dialog's 100 ms fade-in could already readfinishedwhile the page still showed an earlier frame of it. WebKit reads an animation's time from the clock when a script asks, but it puts the animated value on the page only when it renders a frame. On the runner, frames came 100 to 300 ms apart.So the wait's first look found nothing
runningand returned. axe then measured a half-faded dialog and its backdrop. A diagnostic run on Linux WebKit (run 45729918494) recorded this in every failure:Across the failures, the fades were 102–173 ms into their 100 ms, at 0.53 to 0.95 opacity.
The answers to the questions in the brief:
document.getAnimations()lists the popup's and the backdrop'sCSSAnimations in both engines, with the document's timeline. WebKit has no separate frame betweendata-starting-stylegoing and the fade appearing: this dialog's fade is a CSS animation, which starts at mount, and it's listed from then on. What WebKit gets wrong isfinishedcoming before the page shows the fade's end.aria-hiddenorinert(checked in both). Under a fully faded-in backdrop the sidebar passes. Mid-fade, axe measures it through the semi-transparent backdrop and it fails, which is the light-theme failure. In dark theme, the dialog's own text was faded too.The fix
The wait now ends only after a frame in which nothing runs. When it finds nothing running, it waits one frame and looks again. A WebKit frame applies the fade's last value and drops the finished animations, so the second look finds the page at rest. This costs one frame per axe check in Chromium.
There's no longer timeout, no retry and no rule exclusion.
Evidence
vp run browsersfinishedat 0.90 or 0.84 opacity. The frame came 196 or 297 ms later, with no animations left and opacity 1, and axe found 0 violations.diag/webkit-dialog-fade, a temporary diagnostic branch that isn't for merging.Gate
On this head (6076ffe, on 8127d64):
vp run ready: green, 34 of 34 steps.vp run browsers(macOS WebKit): green, 565 passed, 138 skipped.🤖 Generated with Claude Code