Commit 5b80ea6
AX: Ensure native HTML radio buttons on macOS maintain accurate group count when group membership changes
https://bugs.webkit.org/show_bug.cgi?id=297929
rdar://159221583
Reviewed by Tyler Wilcock.
When the membership of a native HTML radio group changes (e.g., adding one or more radio buttons to a group via user interaction),
AccessibilityNodeObject::radioButtonGroup() determines group membership when the AX object is first created. However,
any membership changes must also be propagated to the platform accessibility API so that the backing AX object used for querying
current AX state (mirrored in the AX isolated tree) is kept up-to-date.
This PR ensures that upon radio group membership change, a new AXNotification::RadioGroupMembershipChanged is dispatched for every
radio in the affected group. In this manner, assistive technologies will convey the accurate group count "X of Y" for existing members,
where X is the radio's current position in the group and Y is the group count.
Note: the cardinality of radio buttons is not derived from AXProperty::PosInSet nor AXProperty::SetSize because these attributes are
not queried by the platform accessibility API for this purpose. For native radio buttons, the "X of Y" assistive technology
announcement is exposed via NSAccessibilityLinkedUIElementsAttribute which calls into
AXCoreObject::linkedObjects().
* LayoutTests/accessibility/radio-button-group-dynamic-changes-expected.txt: Added.
* LayoutTests/accessibility/radio-button-group-dynamic-changes.html: Added.
* LayoutTests/platform/glib/TestExpectations: skip radio-button-group-dynamic-changes.html.
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AXNotifications.h:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::onRadioGroupMembershipChanged):
(WebCore::AXObjectCache::updateIsolatedTree):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperties):
(WebCore::createIsolatedObjectData):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
* Source/WebCore/dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroups::addButton):
(WebCore::RadioButtonGroups::removeButton):
Canonical link: https://commits.webkit.org/299585@main1 parent ad64bde commit 5b80ea6
11 files changed
Lines changed: 113 additions & 6 deletions
File tree
- LayoutTests
- accessibility
- platform/glib
- Source/WebCore
- accessibility
- isolatedtree
- dom
Lines changed: 21 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 | + | |
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 | |
|---|---|---|---|
| |||
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
| 958 | + | |
958 | 959 | | |
959 | 960 | | |
960 | 961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1090 | 1090 | | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | | - | |
1094 | | - | |
| 1093 | + | |
| 1094 | + | |
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1929 | 1929 | | |
1930 | 1930 | | |
1931 | 1931 | | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
1932 | 1945 | | |
1933 | 1946 | | |
1934 | 1947 | | |
| |||
4941 | 4954 | | |
4942 | 4955 | | |
4943 | 4956 | | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
4944 | 4960 | | |
4945 | 4961 | | |
4946 | 4962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
790 | 793 | | |
791 | 794 | | |
792 | 795 | | |
| |||
2072 | 2075 | | |
2073 | 2076 | | |
2074 | 2077 | | |
2075 | | - | |
2076 | | - | |
| 2078 | + | |
2077 | 2079 | | |
2078 | 2080 | | |
2079 | 2081 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
0 commit comments