Commit 2b26333
committed
AX: Elements with display: contents and content in a shadowroot do not have their content read when referenced by aria-labelledby
https://bugs.webkit.org/show_bug.cgi?id=275222
rdar://129361833
Reviewed by Joshua Hoffman.
When computing accessible names for elements referenced by aria-labelledby,
textUnderElement() relies on the render tree to find children. For display:contents
shadow hosts, there is no renderer, so shadow root content was never included.
The fix adds special handling in accessibleNameForNode() to explicitly traverse
shadow root content for display:contents elements.
* LayoutTests/accessibility/aria-labelledby-display-contents-shadow-root-expected.txt: Added.
* LayoutTests/accessibility/aria-labelledby-display-contents-shadow-root.html: Added.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::accessibleNameForNode):
Canonical link: https://commits.webkit.org/305918@main1 parent 842e79a commit 2b26333
File tree
3 files changed
+63
-0
lines changed- LayoutTests/accessibility
- Source/WebCore/accessibility
3 files changed
+63
-0
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 36 additions & 0 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 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4279 | 4279 | | |
4280 | 4280 | | |
4281 | 4281 | | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
| 4296 | + | |
| 4297 | + | |
4282 | 4298 | | |
4283 | 4299 | | |
4284 | 4300 | | |
| |||
0 commit comments