Bug 251577

Summary: AX: Object IDs should not be generated with AXTreeStore::generateNewID().
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, jdiggs, 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 2023-02-02 04:36:39 PST
Fallout from fix for https://bugs.webkit.org/show_bug.cgi?id=249480.
Comment 1 Radar WebKit Bug Importer 2023-02-02 04:36:54 PST
<rdar://problem/104956200>
Comment 2 Andres Gonzalez 2023-02-02 04:49:17 PST
Created attachment 464813 [details]
Patch
Comment 3 Tyler Wilcock 2023-02-02 09:07:39 PST
Comment on attachment 464813 [details]
Patch

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

I'm surprised that this bug didn't cause any tests to fail. Is it testable in any way?

> Source/WebCore/accessibility/AXObjectCache.h:239
> +    AccessibilityObject* objectForID(const AXID id) const { return m_objects.get(id); }

Why not use a reference here?
Comment 4 Andres Gonzalez 2023-02-02 09:28:34 PST
(In reply to Tyler Wilcock from comment #3)
> Comment on attachment 464813 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=464813&action=review
> 
> I'm surprised that this bug didn't cause any tests to fail. Is it testable
> in any way?

This is going away with the TextMarker reword, so I don't think it is worthy creating a test at this point.
> 
> > Source/WebCore/accessibility/AXObjectCache.h:239
> > +    AccessibilityObject* objectForID(const AXID id) const { return m_objects.get(id); }
> 
> Why not use a reference here?

because it can be null, i.e., the tree can be requested for an AXID that is no longer there.
Comment 5 EWS 2023-02-06 15:54:38 PST
Committed 259922@main (c11d33bb0bb2): <https://commits.webkit.org/259922@main>

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