Repository navigation
Fix axe scan hiding the current revealjs slide after navigation - #15030
Merged
Merged
Conversation
To let axe check every slide, the scan strips hidden, aria-hidden and inert from all slides and restores them afterwards. inert was already recomputed from the live Reveal state, but hidden and aria-hidden were replayed from the snapshot taken before the scan. Moving to another slide while axe.run is pending therefore put aria-hidden="true" back on the slide now on screen, hiding it from screen readers until the next navigation. The console and json output modes never navigate after the scan, so nothing corrected it. Skip replaying the saved attributes for the current slide (and the stack containing it) and apply the same check to inert. Other slides keep their saved values, and reveal.js has already hidden the slide that was left.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
3 of 5 tasks
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.
With
axeenabled in arevealjspresentation, moving to another slide while the scan runs leaves the new current slide withhiddenandaria-hidden="true". Screen readers skip it until the next navigation. Withoutput: consoleoroutput: jsonnothing navigates after the scan, so the state stays wrong.Root cause
Since #14125 (first shipped in v1.9.26), the axe checker removes
hiddenandaria-hiddenfrom every slide so axe can check off-screen slides, then puts them back onceaxe.runresolves. The values put back are a snapshot taken before the scan, so a slide change in between gives the new current slide its old hidden state. #15010 already recomputesinertfrom the live Reveal state at that point, buthiddenandaria-hiddenwere still replayed from the snapshot.Fix
revealRestoreSlides()insrc/resources/formats/html/axe/axe-check.jsno longer replays the saved values on the current slide and its vertical stack, and uses the same check forinert. Other slides get their saved values back, and reveal.js has already hidden the slide that was left.The new Playwright test navigates as soon as the scan unhides the slides. It fails before the fix, including on v1.10.19, and passes after.
Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.