Commit d334117
committed
bug symfony#65625 [ErrorHandler] Fix what the exception page announces to assistive technologies (Nitram1123)
This PR was merged into the 8.2 branch.
Discussion
----------
[ErrorHandler] Fix what the exception page announces to assistive technologies
| Q | A
| ------------- | ---
| Branch? | 8.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
The exception page redesign (symfony#64766) gained a lot of structure, and in a few spots what
is announced to assistive technologies drifted from what the page actually does.
**Collapsed content stays in the accessibility tree.** The exception chain and the log
rows collapse with `grid-template-rows: 0fr`, which hides them visually but leaves
them readable: the summary announces `aria-expanded="false"` and a screen reader then
reads everything it claims to have collapsed. Collapsing now also flips `visibility`,
delayed to match the animation so the transition still plays, and reduced motion drops
both.
**The log filters declare themselves as menus.** `aria-haspopup="true"` promises a
menu, but what opens is a group of native checkboxes. Those checkboxes are already
fully accessible as they are, `Tab` reaches them and `Space` toggles them, so there is
nothing to build: this drops the false promise and names the group being revealed.
`Escape` closed the menu while a checkbox held the focus, which sent the focus back to
the document, so it now hands it to the trigger instead.
**Copying is silent.** The three copy controls swap an icon for 1.5s and nothing else.
A single `role="status"` region now announces each copy, and clears itself afterwards
so it does not linger in browse mode. It is rendered by `exception.html.php` rather
than injected from JavaScript: the profiler embeds this fragment and scopes the
stylesheet to it, so a region appended to `document.body` would stay unstyled there
and print its text on the page.
**The per-line copy control is mouse-only.** It was a `<span>` with no role, no
`tabindex` and no accessible name, revealed on hover. It is now a named `<button>`,
still hidden until hover, and revealed when it receives focus. The cost is one extra
tab stop per visible trace frame; hidden vendor frames are not affected.
**A log line is announced as one run-on string.** `07:50:09INFOrequestMatched
route "..."` is what NVDA announces on Chrome, while JAWS spaces the same line
correctly. Nothing guarantees that space in this context: the accname specification
leaves the case open. Composing the name with `aria-labelledby` removes the
uncertainty, since concatenation from IDREFs is specified to join with a single
space, one space for everyone, and the NVDA problem goes away.
Commits
-------
3a10a34 [ErrorHandler] Fix what the exception page announces to assistive technologies6 files changed
+127-20Lines changed: 127 additions & 20 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src/Symfony/Component/ErrorHandler
- Resources
- assets
- css
- js
- views
- Tests/ErrorRenderer
Expand file treeCollapse file tree
Open diff view settings
Collapse file
src/Symfony/Component/ErrorHandler/Resources/assets/css/exception.css
Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/assets/css/exception.css+17-6Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
144 | 144 | |
145 | 145 | |
146 | 146 | |
| 147 | + |
147 | 148 | |
148 | 149 | |
149 | 150 | |
| ||
336 | 337 | |
337 | 338 | |
338 | 339 | |
339 | | - |
| 340 | + |
340 | 341 | |
341 | | - |
| 342 | + |
| 343 | + |
| 344 | + |
| 345 | + |
| 346 | + |
| 347 | + |
342 | 348 | |
343 | 349 | |
344 | 350 | |
| ||
491 | 497 | |
492 | 498 | |
493 | 499 | |
494 | | - |
495 | | - |
| 500 | + |
| 501 | + |
| 502 | + |
496 | 503 | |
497 | 504 | |
498 | 505 | |
| ||
665 | 672 | |
666 | 673 | |
667 | 674 | |
668 | | - |
| 675 | + |
| 676 | + |
669 | 677 | |
670 | 678 | |
671 | 679 | |
672 | 680 | |
673 | 681 | |
674 | | - |
| 682 | + |
| 683 | + |
| 684 | + |
| 685 | + |
Collapse file
src/Symfony/Component/ErrorHandler/Resources/assets/js/exception.js
Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/assets/js/exception.js+37-5Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
32 | 47 | |
33 | 48 | |
34 | 49 | |
35 | | - |
36 | | - |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
37 | 57 | |
38 | 58 | |
39 | 59 | |
| ||
170 | 190 | |
171 | 191 | |
172 | 192 | |
| 193 | + |
173 | 194 | |
174 | 195 | |
175 | 196 | |
| ||
200 | 221 | |
201 | 222 | |
202 | 223 | |
203 | | - |
| 224 | + |
204 | 225 | |
205 | 226 | |
206 | 227 | |
| ||
257 | 278 | |
258 | 279 | |
259 | 280 | |
260 | | - |
| 281 | + |
| 282 | + |
| 283 | + |
261 | 284 | |
262 | 285 | |
263 | 286 | |
| ||
387 | 410 | |
388 | 411 | |
389 | 412 | |
390 | | - |
| 413 | + |
| 414 | + |
| 415 | + |
| 416 | + |
| 417 | + |
| 418 | + |
| 419 | + |
| 420 | + |
| 421 | + |
| 422 | + |
391 | 423 | |
392 | 424 | |
393 | 425 | |
Collapse file
src/Symfony/Component/ErrorHandler/Resources/views/exception.html.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/views/exception.html.php+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
79 | 79 | |
80 | 80 | |
81 | 81 | |
| 82 | + |
| 83 | + |
| 84 | + |
Collapse file
src/Symfony/Component/ErrorHandler/Resources/views/logs.html.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/views/logs.html.php+16-7Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
27 | | - |
| 26 | + |
| 27 | + |
28 | 28 | |
29 | 29 | |
30 | 30 | |
| ||
58 | 58 | |
59 | 59 | |
60 | 60 | |
| 61 | + |
61 | 62 | |
62 | 63 | |
63 | 64 | |
| ||
74 | 75 | |
75 | 76 | |
76 | 77 | |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
77 | 86 | |
78 | 87 | |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
84 | 93 | |
85 | 94 | |
86 | 95 | |
|
Collapse file
src/Symfony/Component/ErrorHandler/Resources/views/trace.html.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Resources/views/trace.html.php+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
16 | 16 | |
17 | 17 | |
18 | 18 | |
19 | | - |
| 19 | + |
20 | 20 | |
21 | 21 | |
22 | | - |
| 22 | + |
23 | 23 | |
24 | 24 | |
25 | 25 | |
|
Collapse file
src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/HtmlErrorRendererTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/HtmlErrorRendererTest.php+52Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
| 16 | + |
| 17 | + |
16 | 18 | |
| 19 | + |
| 20 | + |
| 21 | + |
17 | 22 | |
18 | 23 | |
19 | 24 | |
| ||
124 | 129 | |
125 | 130 | |
126 | 131 | |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
127 | 179 | |
128 | 180 | |
129 | 181 | |
|
0 commit comments