[webkit-changes] [WebKit/WebKit] 797dc8: AX: The temporary empty isolated tree that is crea...

AndresGonzalezApple noreply at github.com
Tue Oct 10 11:35:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 797dc8386138913d6d308657fa39e7559b9d43ee
      https://github.com/WebKit/WebKit/commit/797dc8386138913d6d308657fa39e7559b9d43ee
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h

  Log Message:
  -----------
  AX: The temporary empty isolated tree that is created while the full tree is built, is updated unnecessarily.
https://bugs.webkit.org/show_bug.cgi?id=262933
<rdar://problem/116712962>

Reviewed by Tyler Wilcock.

When AXObjectCache::getOrCreateIsolatedTree creates a temporary, empty isolated tree, it schedules the asynchronous creation of the full tree on the m_buildIsolatedTreeTimer. Between the creation of the empty tree and the firing of the m_buildIsolatedTreeTimer, there are multiple calls to update methods of the empty isolated tree, including expensive calls to AXIsolatedTree::updateChildren. These updates are wasted work since the temporary tree is discarded and the full tree construction will include those updates. This unnecessary work is particularly significant when opening large web pages. This patch fixes the problem by avoiding any updates to the temporary, empty isolated tree with the introduction of isUpdatingSubtree().

* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::createEmpty):
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updatePropertiesForSelfAndDescendants):
(WebCore::AXIsolatedTree::updateNodeProperties):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::updateChildrenForObjects):
(WebCore::AXIsolatedTree::updateFrame):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
(WebCore::AXIsolatedTree::isUpdatingSubtree const):
(WebCore::AXIsolatedTree::updatingSubtree):

Canonical link: https://commits.webkit.org/269157@main




More information about the webkit-changes mailing list