Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AX: Isolated objects in the full tree may be accessed before the tree…
… is completely built. https://bugs.webkit.org/show_bug.cgi?id=263248 <rdar://problem/117075862> Reviewed by Tyler Wilcock. When building the isolated tree for a given page, we first build a temporary tree consisting only of the ScrollView and the WebArea objects. The purpose of this temporary tree is to serve client's requests while the full tree is being built, which will keep the main thread busy and client's requests that required the main thread blocked. However that goal is not achieved in cases where the following sequence of events occur: 1. Clients holds a reference to the ScrollView object wrapper from the temporary tree. Let that wrapper be called W. 2. During building the full tree a new isolated object is created for the ScrollView object and attached to W since it represents the same underlying liveobject. 3. From that point on, all calls into W access the object that is part of the full isolated tree, not the temporary tree object. This happens during the construction of the full tree. This issue defeats the purpose of the temporary tree. See comment in bugzilla for a log output showing the problem. This patch solves the problem by not attaching the wrappers to newly created isolated objects immediately upon creation, but instead attaching all wrappers once the entire tree is built and the temporary tree is about to be replaced by the full tree. This apply to isolated objects whose wrappers were attached on the main thread. The same principle is applied to tree updates. * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::nodeChangeForObject): (WebCore::AXIsolatedTree::queueAppendsAndRemovals): (WebCore::AXIsolatedTree::applyPendingChanges): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h: Canonical link: https://commits.webkit.org/269435@main
- Loading branch information