Commit 24ef939
committed
AX: Controls with aria-labelledby should use native label geometry when both they and their ARIA label has no visible bounding box
https://bugs.webkit.org/show_bug.cgi?id=308022
rdar://problem/170518900
Reviewed by Joshua Hoffman.
When a visually-hidden control has both aria-labelledby pointing to a visually-hidden element and a
native <label for> element with visible geometry, we were unable to compute a bounding box
for the control because we rejected the native label relationship entirely when ARIA
labelling existed. This was done because ARIA labels beat out native labels in the accname
calculation.
This patch introduces NativeLabelFor/NativeLabeledBy relations that are always created
for label-for="id" associations, independent of the presence of ARIA labelling. The existing
LabelFor/LabeledBy relations continue to respect ARIA precedence for accessible name calculation.
In relativeFrame(), we now fall back to native label geometry when ARIA labels don't
provide a usable frame.
* LayoutTests/accessibility/native-label-geometry-with-aria-labelledby-expected.txt: Added.
* LayoutTests/accessibility/native-label-geometry-with-aria-labelledby.html: Added.
* Source/WebCore/accessibility/AXCoreObject.h:
(WebCore::AXCoreObject::nativeLabeledByObjects const):
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::symmetricRelation):
(WebCore::AXObjectCache::addLabelForRelation):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::relativeFrame const):
Canonical link: https://commits.webkit.org/307727@main1 parent 6ad274b commit 24ef939
File tree
7 files changed
+112
-12
lines changed- LayoutTests
- accessibility
- platform/glib
- Source/WebCore/accessibility
- isolatedtree
7 files changed
+112
-12
lines changedLines changed: 12 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 | + | |
Lines changed: 58 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 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
910 | 913 | | |
911 | 914 | | |
912 | 915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
| |||
762 | 764 | | |
763 | 765 | | |
764 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
765 | 772 | | |
766 | 773 | | |
767 | 774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
576 | 582 | | |
577 | 583 | | |
578 | 584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5675 | 5675 | | |
5676 | 5676 | | |
5677 | 5677 | | |
| 5678 | + | |
| 5679 | + | |
| 5680 | + | |
| 5681 | + | |
5678 | 5682 | | |
5679 | 5683 | | |
5680 | 5684 | | |
| |||
6009 | 6013 | | |
6010 | 6014 | | |
6011 | 6015 | | |
6012 | | - | |
6013 | | - | |
| 6016 | + | |
| 6017 | + | |
| 6018 | + | |
| 6019 | + | |
| 6020 | + | |
| 6021 | + | |
| 6022 | + | |
6014 | 6023 | | |
6015 | 6024 | | |
6016 | 6025 | | |
| |||
Lines changed: 15 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1227 | 1227 | | |
1228 | 1228 | | |
1229 | 1229 | | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
1240 | 1245 | | |
1241 | 1246 | | |
1242 | 1247 | | |
| |||
0 commit comments