Bug 267768 - AX: The AccessibilityText property of labeled objects is not updated when the label is removed.
Summary: AX: The AccessibilityText property of labeled objects is not updated when the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-01-19 08:32 PST by Andres Gonzalez
Modified: 2024-01-19 18:15 PST (History)
10 users (show)

See Also:


Attachments
Patch (5.45 KB, patch)
2024-01-19 08:54 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].