revealjs: the `axe` option checks contrast only on the slide shown when the deck loads

未關閉
#15,402 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
javascript, playwright

研究方向

Start with src/resources/formats/html/axe/axe-check.js, especially init() and revealUnhideSlides() at the linked lines, and trace how reveal.js slide visibility affects axe's color-contrast rule. Reproduce with the two-slide Quarto deck in the issue and compare the initial scan with a scan after changing slides. Done means contrast failures on non-current slides are reported, or the report clearly states that only the current slide was checked.

由索引模型根據 Issue 內容生成。

描述

accessibility bug revealjs
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

In a revealjs deck, axe runs once, at page load. init() sets up a rescan only for dashboards, not on slide change:

https://github.com/quarto-dev/quarto-cli/blob/cda41021442b20964e10e265b9dcdf81f490c18e/src/resources/formats/html/axe/axe-check.js#L589-L615

Before the scan, revealUnhideSlides() removes hidden, aria-hidden and inert from every slide so that all slides get checked:

https://github.com/quarto-dev/quarto-cli/blob/cda41021442b20964e10e265b9dcdf81f490c18e/src/resources/formats/html/axe/axe-check.js#L474-L492

But reveal.js also gives the slides that are not shown opacity: 0 (classes past and future).
axe treats them as invisible and skips them for color-contrast, so only the slide that is current at load is checked, usually the title slide.
Rules that do not depend on visibility still run on the other slides: an <img> without alt on the last slide is reported by axe: true at load.

The bgOverlap incomplete results of #14964 are a separate problem, on the current slide.

Steps to reproduce
---
title: Deck
format:
  revealjs:
    axe: true
---

## Slide

[Light grey text on white]{style="color: #cccccc;"}

## Another slide

[More light grey text]{style="color: #cccccc;"}

Open the deck at 1400x900. After the axe check has finished (body[data-quarto-axe-complete]), remove hidden, aria-hidden and inert from .reveal .slides > section as revealUnhideSlides() does, and run axe.run(document, {runOnly: {type: "rule", values: ["color-contrast"]}}).

Actual behavior
  • Quarto's axe: true prints nothing about contrast in the console.
  • After the unhide, both grey-text slides have display: block, visibility: visible and opacity: 0.
  • axe 4.10.3 and axe 4.14.1 both return no color-contrast violation and no incomplete result for the grey text.
  • With Reveal.slide(1) before running axe, axe 4.14.1 reports the grey text on that slide: "Element has insufficient color contrast of 1.6 (foreground color: #cccccc, background color: #ffffff, ...)".
  • With <img src="logo.svg"> added to the last slide, axe: true logs the image-alt failure at load, while that slide has opacity: 0.
Expected behavior

color-contrast checks every slide, or the report says that only the current slide was checked.

Your environment
  • IDE: none (terminal), Chromium via Playwright
  • OS: Windows 11
  • Same with Quarto 1.11.9, 1.12.3 and current main (cda4102).
Quarto check output
Quarto 1.12.3
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.13.0: OK
      Dart Sass version 1.107.1: OK
      Deno version 2.9.8: OK
      Typst version 0.15.1: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.12.3
[>] Checking tools....................OK
      TinyTeX: v2026.11
      VeraPDF: 1.30.3
      Chrome Headless Shell: (not installed)
主要語言
JavaScript
星號
6.2k
分支
492
平均合併
15 小時 15 分鐘
30 天內合併 PR
94

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

quarto-dev/quarto-cli 的其他 Issue

查看 quarto-dev/quarto-cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。