Bug 238460 - AX: Don't detach children in AXIsolatedTree::applyPendingChanges for nodes being updated (removed and added)
Summary: AX: Don't detach children in AXIsolatedTree::applyPendingChanges for nodes be...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-28 10:52 PDT by Tyler Wilcock
Modified: 2022-03-29 17:35 PDT (History)
10 users (show)

See Also:


Attachments
Patch (6.70 KB, patch)
2022-03-28 11:06 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (14.66 KB, patch)
2022-03-28 19:07 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (14.83 KB, patch)
2022-03-29 08:38 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2022-03-28 10:52:08 PDT
In AXIsolatedTree::updateNode, we perform the update by queuing the node to be removed, and then queueing it to be added.

When performing the removal in AXIsolatedTree::applyPendingChanges, we call AXCoreObject::detach, which unconditionally calls AXCoreObject::detachRemoteParts. Specifically, AXIsolatedObject::detachRemoteParts detaches all the object's children from the itself (by setting their m_parentID to zero). Then, when we start applying m_pendingAppends, we re-add the object, but never re-attach the children, resulting in a broken tree.
Comment 1 Radar WebKit Bug Importer 2022-03-28 10:52:19 PDT
<rdar://problem/90932915>
Comment 2 Tyler Wilcock 2022-03-28 11:06:38 PDT
Created attachment 455930 [details]
Patch
Comment 3 Tyler Wilcock 2022-03-28 19:07:16 PDT
Created attachment 455979 [details]
Patch
Comment 4 Andres Gonzalez 2022-03-29 04:30:47 PDT
(In reply to Tyler Wilcock from comment #3)
> Created attachment 455979 [details]
> Patch

--- a/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
+++ a/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp

@@ -307,7 +307,7 @@ void AXIsolatedTree::updateNode(AXCoreObject& axObject)

-    m_pendingNodeRemovals.append(axID);
+    m_pendingNodeRemovals.append(std::make_pair(axID, AccessibilityDetachmentType::ElementChanged));

Can we use an initializer list for the pair?

    m_pendingNodeRemovals.append({ axID, AccessibilityDetachmentType::ElementChanged });

@@ -545,10 +545,11 @@ void AXIsolatedTree::applyPendingChanges()

+        auto axID = removal.first;

Don't need this local variable.
Comment 5 Tyler Wilcock 2022-03-29 08:38:19 PDT
Created attachment 456028 [details]
Patch
Comment 6 EWS 2022-03-29 17:35:36 PDT
Committed r292086 (249013@main): <https://commits.webkit.org/249013@main>

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