RESOLVED FIXED 260278
AX: aria-selected-menu-items test is flaky in ITM mode
https://bugs.webkit.org/show_bug.cgi?id=260278
Summary AX: aria-selected-menu-items test is flaky in ITM mode
Joshua Hoffman
Reported 2023-08-16 11:30:34 PDT
The accessibility/aria-selected-menu-items test is flaky when run in ITM mode.
Attachments
Patch (6.73 KB, patch)
2023-08-16 20:37 PDT, Joshua Hoffman
no flags
Patch (8.03 KB, patch)
2023-08-18 17:44 PDT, Joshua Hoffman
no flags
Patch (8.04 KB, patch)
2023-08-21 17:28 PDT, Joshua Hoffman
no flags
Patch (9.24 KB, patch)
2023-08-22 13:41 PDT, Joshua Hoffman
no flags
Patch (9.24 KB, patch)
2023-08-23 13:03 PDT, Joshua Hoffman
no flags
Patch (9.20 KB, patch)
2023-08-23 21:30 PDT, Joshua Hoffman
no flags
Radar WebKit Bug Importer
Comment 1 2023-08-16 11:30:46 PDT
Joshua Hoffman
Comment 2 2023-08-16 20:37:33 PDT
Joshua Hoffman
Comment 3 2023-08-18 17:44:41 PDT
Andres Gonzalez
Comment 4 2023-08-21 07:45:57 PDT
(In reply to Joshua Hoffman from comment #3) > Created attachment 467336 [details] > Patch """ This change fixes aria-selected-menu-items in isolated tree mode by adding a traversal up for the newly selected child so that its ancestor also updates. """ so that it's ancestor also updates. -> so that its ancestor also updates. --- a/Source/WebCore/accessibility/AXObjectCache.cpp +++ b/Source/WebCore/accessibility/AXObjectCache.cpp + case AXMenuListItemSelected: + if (RefPtr ancestor = Accessibility::findAncestor<AccessibilityObject>(*notification.first, false, [] (const auto& object) { + return object.canHaveSelectedChildren(); + })) { I think that declaring ancestor = Accessibility::findAncestor above the if statement is more legible. --- a/LayoutTests/accessibility/aria-selected-menu-items.html +++ b/LayoutTests/accessibility/aria-selected-menu-items.html - selectedChildInfo(window.accessibilityController.accessibleElementById("menu1")); - selectedChildInfo(window.accessibilityController.accessibleElementById("menu2")); + testOutput += await selectedChildInfo(window.accessibilityController.accessibleElementById("menu1"), "item2"); + testOutput += await selectedChildInfo(window.accessibilityController.accessibleElementById("menu2"), "item5"); You can get rid of the window. in window.accessibilityController.
Joshua Hoffman
Comment 5 2023-08-21 17:28:05 PDT
chris fleizach
Comment 6 2023-08-21 22:30:12 PDT
Comment on attachment 467376 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=467376&action=review > Source/WebCore/accessibility/AXObjectCache.cpp:4019 > + return object.canHaveSelectedChildren(); should this try to find a matching role instead of canHaveSelectedChildren? there may possibly be a mismatch in what is found > Source/WebCore/accessibility/AXObjectCache.cpp:4022 > + updateNode(ancestor); are we able to update just a single property for the ancestor? (I'm not sure what's happening in updateNode)
Joshua Hoffman
Comment 7 2023-08-22 13:37:01 PDT
(In reply to chris fleizach from comment #6) > Comment on attachment 467376 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=467376&action=review > > > Source/WebCore/accessibility/AXObjectCache.cpp:4019 > > + return object.canHaveSelectedChildren(); > > should this try to find a matching role instead of canHaveSelectedChildren? > there may possibly be a mismatch in what is found Definitely—we can check for menu or menubar roles instead. > > Source/WebCore/accessibility/AXObjectCache.cpp:4022 > > + updateNode(ancestor); > > are we able to update just a single property for the ancestor? (I'm not sure > what's happening in updateNode) After some more investigation we can do this via an update to AXPropertyName::SelectedChildren.
Joshua Hoffman
Comment 8 2023-08-22 13:41:25 PDT
Joshua Hoffman
Comment 9 2023-08-23 13:03:32 PDT
EWS
Comment 10 2023-08-23 20:56:17 PDT
Commit message contains (OOPS!) and no reviewer found, blocking PR #None
Joshua Hoffman
Comment 11 2023-08-23 21:30:02 PDT
EWS
Comment 12 2023-08-24 01:47:34 PDT
Committed 267221@main (5e54c0b0e654): <https://commits.webkit.org/267221@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 467409 [details].
Note You need to log in before you can comment on or make changes to this bug.