Bug 239499 - Only AXIsolatedTree::update{Children,Node} once when processing notifications in AXObjectCache::updateIsolatedTree
Summary: Only AXIsolatedTree::update{Children,Node} once when processing notifications...
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-04-19 08:24 PDT by Tyler Wilcock
Modified: 2022-04-21 13:52 PDT (History)
10 users (show)

See Also:


Attachments
Patch (4.83 KB, patch)
2022-04-19 08:32 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (4.83 KB, patch)
2022-04-19 09:06 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-04-19 08:24:38 PDT
Currently, we do try to prevent performing duplicate updates, but we do so only if we have an exact match for a previous notification for any given object:

case AXTextChanged:
case AXValueChanged: {

    bool needsUpdate = appendIfNotContainsMatching(filteredNotifications, notification, [&notification] (const std::pair<RefPtr<AXCoreObject>, AXNotification>& note) {
       return note.second == notification.second && note.first.get() == notification.first.get();
    });

    if (needsUpdate)
        tree->updateNode(*notification.first);
   

However, multiple notifications trigger AXIsolatedTree::updateNode and children, so we'll still do wasted work in this case. For example, in the above snippet, we'd update the node twice if the same object got both an AXTextChanged and AXValueChanged notification in the same batch.
Comment 1 Radar WebKit Bug Importer 2022-04-19 08:24:47 PDT
<rdar://problem/91961437>
Comment 2 Tyler Wilcock 2022-04-19 08:32:22 PDT
Created attachment 457894 [details]
Patch
Comment 3 Tyler Wilcock 2022-04-19 09:06:42 PDT
Created attachment 457903 [details]
Patch
Comment 4 EWS 2022-04-21 13:52:51 PDT
Committed r293186 (249862@main): <https://commits.webkit.org/249862@main>

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