[Webkit-unassigned] [Bug 260621] AX: aria-controls-with-tabs fails in ITM

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 25 07:22:15 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=260621

--- Comment #14 from Andres Gonzalez <andresg_22 at apple.com> ---
(In reply to Joshua Hoffman from comment #9)
> Created attachment 467419 [details]
> Patch

--- a/Source/WebCore/accessibility/AXObjectCache.cpp
+++ b/Source/WebCore/accessibility/AXObjectCache.cpp

+        else if (oldObject) {
+            RefPtr oldFocusedControlledPanelItem = Accessibility::findAncestor<AccessibilityObject>(*oldObject, false, [] (auto& axObject) {

oldFocusedControlledPanelItem --> oldFocusedControlledPanel
axObject --> ancestor

+                return axObject.roleValue() == AccessibilityRole::TabPanel && axObject.controllers().size();
+            });
+
+            if (oldFocusedControlledPanelItem) {
+                auto oldControllers = oldFocusedControlledPanelItem->controllers();

I think that in findAncestor, you only need to find the closest panel ancestor, not a panel with controllers. Then if you do find a panel, you can check the controllers and update them.

The rest of the function does the same thing for the new focus. Avoid the code duplication, maybe using a lambda. Also account for the case where the old panel and the new panel are the same, in which case you only need to check for controllers and do updates and notifications only once.

--- a/Source/WebCore/accessibility/AXObjectCache.h
+++ b/Source/WebCore/accessibility/AXObjectCache.h

+    void handleTabOrTabPanelSelected(Node*, Node*);

What about updateTabs / updateTabPanels for name?

+inline void AXObjectCache::handleTabOrTabPanelSelected(Node*, Node*) { }

No needed since this is a private method.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230825/77bacc0f/attachment.htm>


More information about the webkit-unassigned mailing list