-
Notifications
You must be signed in to change notification settings - Fork 33
Update reflow-scan text to improve clarity and reference WCAG 2.2 #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+12
−10
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| export default async function reflowScan({ page, addFinding } = {}) { | ||
| export default async function reflowScan({page, addFinding} = {}) { | ||
| const originalViewport = page.viewportSize() | ||
| const url = page.url() | ||
| // Check for horizontal scrolling at 320x256 viewport | ||
| // Check for horizontal scrolling at 320 viewport | ||
| try { | ||
| await page.setViewportSize({ width: 320, height: 256 }) | ||
| await page.setViewportSize({width: 320, height: 256}) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did Prettier automatically do this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, Prettier auto-formatted on save |
||
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth) | ||
| const clientWidth = await page.evaluate(() => document.documentElement.clientWidth) | ||
|
|
||
|
|
@@ -12,10 +12,11 @@ export default async function reflowScan({ page, addFinding } = {}) { | |
| await addFinding({ | ||
| scannerType: 'reflow-scan', | ||
| url, | ||
| problemShort: 'page requires horizontal scrolling at 320x256 viewport', | ||
| problemUrl: 'https://www.w3.org/WAI/WCAG21/Understanding/reflow.html', | ||
| solutionShort: 'ensure content is responsive and does not require horizontal scrolling at small viewport sizes', | ||
| 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).`, | ||
| problemShort: 'needs review: page presents a horizontal scrollbar at a 320px wide viewport', | ||
| problemUrl: 'https://www.w3.org/WAI/WCAG22/Understanding/reflow.html', | ||
| solutionShort: | ||
| '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', | ||
| 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).`, | ||
| }) | ||
| } | ||
| } catch (e) { | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.