Bug 267768

Summary: AX: The AccessibilityText property of labeled objects is not updated when the label is removed.
Product: WebKit Reporter: Andres Gonzalez <andresg_22>
Component: AccessibilityAssignee: Andres Gonzalez <andresg_22>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, samuel_white, tyler_w, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Andres Gonzalez 2024-01-19 08:32:01 PST
.
Comment 1 Radar WebKit Bug Importer 2024-01-19 08:32:11 PST
<rdar://problem/121259687>
Comment 2 Andres Gonzalez 2024-01-19 08:54:41 PST
Created attachment 469459 [details]
Patch
Comment 3 Tyler Wilcock 2024-01-19 11:29:38 PST
Comment on attachment 469459 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=469459&action=review

> Source/WebCore/accessibility/AXObjectCache.cpp:1079
> -    removeRelations(axID);
> -
>  #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
>      if (auto tree = AXIsolatedTree::treeForPageID(m_pageID))
>          tree->removeNode(*object);
>  #endif
>  
> +    removeRelations(axID);

TW: Just curious, why move this? Just for organization, or is there some logical difference?
Comment 4 Andres Gonzalez 2024-01-19 11:50:10 PST
(In reply to Tyler Wilcock from comment #3)
> Comment on attachment 469459 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=469459&action=review
> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:1079
> > -    removeRelations(axID);
> > -
> >  #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
> >      if (auto tree = AXIsolatedTree::treeForPageID(m_pageID))
> >          tree->removeNode(*object);
> >  #endif
> >  
> > +    removeRelations(axID);
> 
> TW: Just curious, why move this? Just for organization, or is there some
> logical difference?

When we call tree->removeNode, the relationships for the live object still have to be alive in order to get its related objects. So that's why removing the live  relations has to be after updating the iso tree. Before it was working because we were not using the relations to get the labeled objects, we were going through the Elements directly.
Comment 5 EWS 2024-01-19 18:15:04 PST
Committed 273251@main (df75d243cd12): <https://commits.webkit.org/273251@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 469459 [details].