[webkit-changes] [WebKit/WebKit] fbca8d: AX: Initialize the AX thread on first client request.

AndresGonzalezApple noreply at github.com
Wed Aug 9 11:25:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fbca8d9e20b93edcecf5c21d427f37d74bcb5ad9
      https://github.com/WebKit/WebKit/commit/fbca8d9e20b93edcecf5c21d427f37d74bcb5ad9
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
    M Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm

  Log Message:
  -----------
  AX: Initialize the AX thread on first client request.
https://bugs.webkit.org/show_bug.cgi?id=259952
<rdar://problem/113592230>

Reviewed by Tyler Wilcock.

The AX thread was being initialize after building an empty isolated tree in AXObjectCache::getOrCreateIsolatedTree. However, there are multiple client requests that happen before the AX thread was initialized that come through the WKAccessibilityWebPageObject. If the main thread is busy parsing and rendering the page, those requests may not be served in a long time, causing clients like VoiceOver to report irresponsive application. That's true especially during the loading of large pages. This patch moves the initialization of the AX thread to the first request received in [WKAccessibilityWebPageObject accessibilityAttributeValue:], mitigating main thread contention in this scenario.

* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreateIsolatedTree):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::initializeAXThreadIfNeeded):
(WebCore::AXObjectCache::initializeSecondaryAXThread): Renamed.
* Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):

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




More information about the webkit-changes mailing list