Bug 235715

Summary: AXLogger::add should not cause tree updates via children()
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch ews-feeder: commit-queue-

Description Tyler Wilcock 2022-01-27 07:54:43 PST
AXLogger::add(TextStream&, const RefPtr<AXCoreObject>&, bool) currently calls the update version of children, causing behavior to potentially be different between builds with logging enabled and logging disabled.

void AXLogger::add(TextStream& stream, const RefPtr<AXCoreObject>& object, bool recursive)
{
    ...truncated...
    if (recursive) {
        for (auto& child : object->children())
            add(stream, child, true);
    }
    ...truncated
}

The logger should only read the current state of the object / tree, never modify it.
Comment 1 Radar WebKit Bug Importer 2022-01-27 07:55:13 PST
<rdar://problem/88132984>
Comment 2 Tyler Wilcock 2022-01-27 07:58:34 PST
Created attachment 450137 [details]
Patch
Comment 3 EWS 2022-01-27 10:00:04 PST
Committed r288676 (246482@main): <https://commits.webkit.org/246482@main>

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