Skip to content

Commit 4f317ce

Browse files
authored
Merge pull request #7 from mgifford/copilot/fix-accessibility-landmarks
Fix landmark accessibility violation for progress and clock elements
2 parents 94f379a + d801b5d commit 4f317ce

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ Only one notes block per slide:
108108
### Required Elements
109109
Keep these in the `<body>` for proper presentation functionality:
110110
```html
111-
<div class="progress"></div>
112-
<div class="clock"></div>
111+
<aside class="progress" aria-label="Presentation progress"></aside>
112+
<aside class="clock" aria-label="Presentation timer"></aside>
113113
<section aria-live="assertive" aria-label="Slide mode status">Leaving slide mode.</section>
114114
```
115115

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
</head>
2525

2626
<body class="shower fade-in duration=30 warn=5 hidemouse">
27-
<div class="progress"></div>
28-
<div class="clock"></div>
27+
<aside class="progress" aria-label="Presentation progress"></aside>
28+
<aside class="clock" aria-label="Presentation timer"></aside>
2929
<section aria-live="assertive" aria-label="Slide mode status">Leaving slide mode.</section>
3030

3131
<main>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"test:html": "html-validate -c .htmlvalidate.json '*.html'",
1010
"test:a11y": "pa11y-ci --config .pa11yci.json || true",
1111
"test:headings": "node scripts/test-heading-order.js",
12-
"test:main-landmark": "bash scripts/check-main-landmark.sh",
12+
"test:landmarks": "bash scripts/test-landmarks.sh",
1313
"test:links": "bash scripts/check-links.sh",
1414
"test:spell": "cspell '**/*.{md,html,js,css}' || true",
1515
"test:css": "bash scripts/validate-css.sh",
16-
"test:all": "npm run test:html && npm run test:css && npm run test:main-landmark && npm run test:links && npm run test:spell",
16+
"test:all": "npm run test:html && npm run test:landmarks && npm run test:css && npm run test:links && npm run test:spell",
1717
"test": "npm run test:all"
1818
},
1919
"repository": {

scripts/test-landmarks.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
# Test that progress and clock elements are contained in landmark regions
3+
# This prevents regression of the accessibility issue where these elements
4+
# were not contained by landmarks.
5+
6+
set -e
7+
8+
echo "🔍 Testing landmark accessibility..."
9+
10+
# Check if progress and clock elements use <aside> tag or have role="complementary"
11+
if ! grep -q '<aside class="progress"' index.html; then
12+
echo "❌ FAIL: .progress element is not using <aside> tag"
13+
exit 1
14+
fi
15+
16+
if ! grep -q '<aside class="clock"' index.html; then
17+
echo "❌ FAIL: .clock element is not using <aside> tag"
18+
exit 1
19+
fi
20+
21+
# Check if progress has aria-label
22+
if ! grep -q 'class="progress".*aria-label' index.html; then
23+
echo "❌ FAIL: .progress element is missing aria-label attribute"
24+
exit 1
25+
fi
26+
27+
# Check if clock has aria-label
28+
if ! grep -q 'class="clock".*aria-label' index.html; then
29+
echo "❌ FAIL: .clock element is missing aria-label attribute"
30+
exit 1
31+
fi
32+
33+
echo "✓ All landmark tests passed"
34+
echo " - .progress is an <aside> element with aria-label"
35+
echo " - .clock is an <aside> element with aria-label"

0 commit comments

Comments
 (0)