Skip to content

Commit dba0765

Browse files
Update reflow-scan text to improve clarity and reference WCAG 2.2 (#231)
Closes #230 Updates the reflow-scan plugin text to improve clarity: - Removes mention of 256 height from comment - Updates `problemShort` to better describe the issue - Updates `problemUrl` to reference WCAG 2.2 instead of 2.1 - Updates `solutionShort` to use more descriptive guidance - Updates `solutionLong` with clearer violation explanation - Updates test strings to match new copy
2 parents cc9c746 + 0aa982f commit dba0765

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

.github/scanner-plugins/reflow-scan/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export default async function reflowScan({ page, addFinding } = {}) {
1+
export default async function reflowScan({page, addFinding} = {}) {
22
const originalViewport = page.viewportSize()
33
const url = page.url()
4-
// Check for horizontal scrolling at 320x256 viewport
4+
// Check for horizontal scrolling at 320 viewport
55
try {
6-
await page.setViewportSize({ width: 320, height: 256 })
6+
await page.setViewportSize({width: 320, height: 256})
77
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth)
88
const clientWidth = await page.evaluate(() => document.documentElement.clientWidth)
99

@@ -12,10 +12,11 @@ export default async function reflowScan({ page, addFinding } = {}) {
1212
await addFinding({
1313
scannerType: 'reflow-scan',
1414
url,
15-
problemShort: 'page requires horizontal scrolling at 320x256 viewport',
16-
problemUrl: 'https://www.w3.org/WAI/WCAG21/Understanding/reflow.html',
17-
solutionShort: 'ensure content is responsive and does not require horizontal scrolling at small viewport sizes',
18-
solutionLong: `The page has a scroll width of ${scrollWidth}px but a client width of only ${clientWidth}px at a 320x256 viewport, requiring horizontal scrolling. This violates WCAG 2.1 Level AA Success Criterion 1.4.10 (Reflow).`,
15+
problemShort: 'needs review: page presents a horizontal scrollbar at a 320px wide viewport',
16+
problemUrl: 'https://www.w3.org/WAI/WCAG22/Understanding/reflow.html',
17+
solutionShort:
18+
'verify if sections of content can be viewed within the 320px wide viewport without needing to scroll in two dimensions to read the content of an individual section',
19+
solutionLong: `The page has a scroll width of ${scrollWidth}px but a client width of only ${clientWidth}px at a 320px wide viewport, resulting in a horizontal scrollbar. Ensure that multi-line text does not require scrolling in two-dimensions to read, as this would be a violation of WCAG Success Criterion 1.4.10 (Reflow).`,
1920
})
2021
}
2122
} catch (e) {

tests/site-with-errors.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ describe('site-with-errors', () => {
112112
{
113113
scannerType: 'reflow-scan',
114114
url: 'http://127.0.0.1:4000/404.html',
115-
problemShort: 'page requires horizontal scrolling at 320x256 viewport',
116-
solutionShort: 'ensure content is responsive and does not require horizontal scrolling at small viewport sizes',
115+
problemShort: 'needs review: page presents a horizontal scrollbar at a 320px wide viewport',
116+
solutionShort:
117+
'verify if sections of content can be viewed within the 320px wide viewport without needing to scroll in two dimensions to read the content of an individual section',
117118
},
118119
]
119120
// Check that:
@@ -161,7 +162,7 @@ describe('site-with-errors', () => {
161162
'Accessibility issue: Headings should not be empty on /404.html',
162163
'Accessibility issue: Elements must meet minimum color contrast ratio thresholds on /about/',
163164
'Accessibility issue: Elements must meet minimum color contrast ratio thresholds on /jekyll/update/2025/07/30/welcome-to-jekyll.html',
164-
'Accessibility issue: Page requires horizontal scrolling at 320x256 viewport on /404.html',
165+
'Accessibility issue: Needs review: page presents a horizontal scrollbar at a 320px wide viewport on /404.html',
165166
]
166167
expect(actualTitles).toHaveLength(expectedTitles.length)
167168
expect(actualTitles).toEqual(expect.arrayContaining(expectedTitles))

0 commit comments

Comments
 (0)