Commit 66ebec8
committed
AX: VoiceOver does not re-resolve aria-labelledby when referenced element's accessible name is provided by aria-label
https://bugs.webkit.org/show_bug.cgi?id=317597
rdar://180319221
Reviewed by Dominic Mazzoni.
When an element references another via aria-labelledby, its accessible name
was not recomputed if the referenced element's name changed via aria-label
(or alt/title) — only text-content changes propagated. In the isolated tree
this left a stale cached name.
AXObjectCache::handleTextChanged walks the changed object's ancestors and
notifies the objects each one labels (labelForObjects()) so their names get
recomputed. That propagation was gated behind `if (isText)`, but aria-label,
alt, and title changes reach handleTextChanged with a non-static-text object,
so the labelledby referrer was never notified.
Hoist the labelForObjects() propagation out of the isText block so it runs for
every text/name change.
* LayoutTests/accessibility/aria-labelledby-updates-when-aria-label-changes-expected.txt: Added.
* LayoutTests/accessibility/aria-labelledby-updates-when-aria-label-changes.html: Added.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleTextChanged):
Canonical link: https://commits.webkit.org/316316@main1 parent aa79ccb commit 66ebec8
3 files changed
Lines changed: 62 additions & 5 deletions
File tree
- LayoutTests/accessibility
- Source/WebCore/accessibility
Lines changed: 13 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 | + | |
Lines changed: 42 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 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1473 | 1473 | | |
1474 | 1474 | | |
1475 | 1475 | | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | 1476 | | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
1482 | 1484 | | |
1483 | 1485 | | |
1484 | 1486 | | |
| |||
0 commit comments