Commit eaaf49c
authored
fix(lint-page): add accessible labels to filters (#17434)
## Summary
Fix 4 WAVE accessibility errors on the Clippy lints page
(#15604).
The `theme-choice` <select> and three version-filter <input> elements
had no programmatically associated labels, making them unidentifiable to
screen readers.
## Changes
- `util/gh-pages/index_template.html:34` — changed `<div
class="setting-radio-name">` to `<label class="setting-radio-name"
for="theme-choice">` to associate the visible "Theme" text with the
select element
- `util/gh-pages/index_template.html:121-123` — added
`for="version-filter-{{ name }}"` on each version label and
`id="version-filter-{{ name }}"` on each version input, producing three
pairings: version-filter-gte, version-filter-lte, version-filter-eq
- `tests/lint-page.rs` (new) — regression test asserting all four label
associations exist in the template
## Not in scope
Colors, contrast, CSS, JavaScript, and lint logic are untouched.
## Convention
Uses `<label for="">`, the same pattern already established in the
template for the search input (line 155).
## Test
cargo test --test lint-page — 1 passed, 0 failed.
changelog: Fix accessible labels for the theme and version filters on
the lint page
Part of #156042 files changed
Lines changed: 37 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
0 commit comments