| Summary: | AX: Relations updates thrash between dirty and clean when multiple deferred id attribute changes are processed | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Tyler Wilcock <tyler_w> | ||||||||||
| Component: | Accessibility | Assignee: | 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: | Other | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Tyler Wilcock
2023-08-17 16:10:40 PDT
Created attachment 467317 [details]
Patch
(In reply to Tyler Wilcock from comment #2) > Created attachment 467317 [details] > Patch AX: Relations updates thrash between dirty and clean when multiple deferred id attribute changes are processed https://bugs.webkit.org/show_bug.cgi?id=260370 rdar://problem/114052085 Reviewed by NOBODY (OOPS!). In AXObjectCache::handleAttributeChange, any change to the `id` attribute causes AXObjectCache::m_relationsNeedUpdate to become true. This is problematic when `m_deferredAttributeChange` contains multiple `id` attribute changes, as we thrash between dirtying m_relationsNeedUpdate, immediately clearing it as a result of a random `parentObject` call, and then re-dirtying it. AG: why paretObject is dirtying the flag? With this patch, we introduce a mechanism to suppress relations updates within a defined scope to avoid needlessly re-computing it over and over. AG: If the problem is caused by multiple id changes being queued, we can just set a local flag in the method that processes the queue to signal that the relations were already updated. But it sounds like the real cause is the dirtying of the flag when it shouldn't be. Created attachment 467334 [details]
Patch
(In reply to Tyler Wilcock from comment #4) > Created attachment 467334 [details] > Patch """ This is problematic when `m_deferredAttributeChange` contains multiple `id` attribute changes, as we thrash between setting m_relationsNeedUpdate to true, immediately resetting it to false as a result of a random `parentObject` call, and then re-dirtying it with the next id attribute change. """ Is it worth clarifying why parentObject() is called? The "random" term here is inaccurate. The re-calculation of the relations occur because parentObject() now calls ownerParentObject(), which forces the relations to be computed. I think parentObject() is called in this context because of accessibilityIsIgnored(). Created attachment 467367 [details]
Patch
Created attachment 467381 [details]
Patch
Found 1 new test failure: media/video-remove-insert-repaints.html I really don't think that's related to this patch. Going to try cq+ again. Found 1 new test failure: media/video-remove-insert-repaints.html Committed 267190@main (f8ef167b97d5): <https://commits.webkit.org/267190@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 467381 [details]. |