AX ITM: Cache several object relationships that were not cached in isolated tree mode.
<rdar://problem/92970244>
Created attachment 459056 [details] Patch
Created attachment 459893 [details] Patch
Comment on attachment 459893 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=459893&action=review Looks good to me! > COMMIT_MESSAGE:3 > + Your COMMIT_MESSAGE is missing a "Reviewed by" below the bug URL and above the long-form commit description.
(In reply to Tyler Wilcock from comment #4) > Comment on attachment 459893 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=459893&action=review > > Looks good to me! > > > COMMIT_MESSAGE:3 > > + > > Your COMMIT_MESSAGE is missing a "Reviewed by" below the bug URL and above > the long-form commit description. I'm not getting the commit message template with the webkit-patch upload script. Does it work only if you have uncommitted changes on the main branch? I have my changes committed in a working branch.
Created attachment 459952 [details] Patch
(In reply to Tyler Wilcock from comment #4) > Comment on attachment 459893 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=459893&action=review > > Looks good to me! > > > COMMIT_MESSAGE:3 > > + > > Your COMMIT_MESSAGE is missing a "Reviewed by" below the bug URL and above > the long-form commit description. Somewhat amended the commit message, but couldn't re-generate the list of changed functions. So I guess we'll go without that this time.
Comment on attachment 459952 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=459952&action=review > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:627 > + return cache->relations(); is this going to make a copy of the relations map? or just assign it the same pointer?
(In reply to chris fleizach from comment #8) > Comment on attachment 459952 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=459952&action=review > > > Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:627 > > + return cache->relations(); > > is this going to make a copy of the relations map? or just assign it the > same pointer? It is a copy accessed only on the AX thread. I.e., we maintain two copies of the m_relations data structure, one in the AXObjectCache and one in the AXIsolatedTree. The one in the cache is only accessed on the main thread and the one on the IsolatedTree is accessed only on the AX thread. The atomic m_relationsNeedUpdate is used to mark that the m_relations in the IsolatedTree is dirty and needs to be copied from the cache's one. Since the copy happens by blocking the AX thread until we get the value from the main thread, I believe we are safe: if (m_relationsNeedUpdate) { m_relations = Accessibility::retrieveValueFromMainThread<HashMap<AXID, AXRelations>>([this] () -> HashMap<AXID, AXRelations> { if (auto* cache = axObjectCache()) return cache->relations(); return { }; }); m_relationsNeedUpdate = false; }
Committed r295139 (251230@main): <https://commits.webkit.org/251230@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 459952 [details].
Landing build fix for !ENABLE(ACCESSIBILITY) in https://github.com/WebKit/WebKit/pull/1262.