Repository navigation
Fix revealjs diagram and image announcements - #15034
Conversation
✅ 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. |
|
As I have merge previous PR, the assets needs to be rebuild. |
Apply the image announcement patch after the screen reader fragment patch from quarto-dev#15020, regenerate UMD/ESM bundles and source maps, and cover image names inside nested fragments.
|
Thanks @cderv, addressed in 7f93ab2. I merged current main and rebuilt the reveal.js 5.1.0 UMD/ESM bundles and both source maps with the fragment announcement fix from #15020 and this PR's image announcement fix applied together. The updater now applies the existing screen-reader patch first, followed by Validation:
The full Quarto test suite was not run. |
cderv
left a comment
There was a problem hiding this comment.
Thanks for the rebuild on top of #15020.
I checked this locally and it looks good to me.
One thing I wanted to check is if the caption would be read twice for a figure without fig-alt. It is not, Quarto does not set alt in that case (Markdown image or knitr fig-cap), so only the caption is announced.
Two small edge cases in getImageName(), both also in the upstream PR, so I think they belong there first so the backport stays the same as upstream:
<div role="img" title="Rated 4 stars">★★★★☆</div>is now announced as nothing, as the contents are skipped and thetitleattribute is not used as a last fallback for the name.aria-labelledbypointing to an<img alt="...">gives an empty name, becausetextContentof an image is empty.
Quarto itself does not produce role="img" in revealjs output, so this only matters for raw HTML or extensions, and I don't think it should block this PR. Would you mind raising them on hakimel/reveal.js#3949 maybe ?
I'll merge this PR as is for now.
|
Thanks @cderv for the review and merge, and for checking the caption behavior. I raised both naming edge cases on the upstream PR, with examples and expected announcements: hakimel/reveal.js#3949 (comment). Agreed that they should be addressed upstream first so the backport stays aligned. |
Each time a revealjs presentation became visible again, such as after switching tabs, reveal.js moved focus to the body. Readers lost their place on a link or chart, and screen readers such as NVDA and JAWS, which pass arrow keys on only while focus is in the deck, dropped back to browse mode. A new patch moves focus out of a frame and onto the deck, and leaves focus where it is everywhere else. - Add the revealjs-0003 patch, applied after 0001 and 0002 - Rebuild the reveal.js bundles and source maps from 5.1.0 - Add a Playwright spec for focus after the page is shown again Fixes #15079 See #15020 and #15034 for the earlier revealjs screen reader fixes.
Description
Fixes #15033.
Backport image announcements to the bundled reveal.js 5.1.0 without upgrading the presentation framework:
styleandscriptcontents, including Mermaid's inline SVG stylesheet.fig-altis included alongside the caption.role="img"elements by their name rather than their presentational descendants, using the fix proposed in Fix screen reader image names and exclude SVG styles hakimel/reveal.js#3949.The readable source patch is included with an updater step that reapplies it and rebuilds the UMD/ESM bundles and source maps. The updater notes that the upstream PR is not yet merged and that both fixes must be present in a future reveal.js release before removing the backport.
This does not include the separate slide/fragment announcement changes in #15020 or change Graphviz's per-node title/label duplication.
Validation
revealjs-image-announcements.spec.ts --workers=1).js/reveal.jsdiffers.Checklist
I have (if applicable):
AI-assisted PR