[webkit-changes] [WebKit/WebKit] 149e7d: AX: Implement accessibilityPresenterProcessIdentif...

Tyler Wilcock noreply at github.com
Fri Jul 7 22:50:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 149e7df3a6f4148707482bb44d95507c946f5fc6
      https://github.com/WebKit/WebKit/commit/149e7df3a6f4148707482bb44d95507c946f5fc6
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-07-07 (Fri, 07 Jul 2023)

  Changed paths:
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
    M Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

  Log Message:
  -----------
  AX: Implement accessibilityPresenterProcessIdentifier to improve attributed string creation performance
https://bugs.webkit.org/show_bug.cgi?id=259009
rdar://problem/111940050

Reviewed by Chris Fleizach.

In WebCore::attributedStringCreate, we do this:

attributedStringSetElement(result.get(), NSAccessibilityLinkTextAttribute, AccessibilityObject::anchorElementForNode(node), range);

In turn, this calls AppKit's NSAccessibilityCreateAXUIElementRef, which then requests the
accessibilityPresenterProcessIdentifier for the given element.

Because WebAccessibilityObjectWrapperMac did not implement accessibilityPresenterProcessIdentifier
prior to this patch, we relied on the default AppKit implementation, which iterates all the way up
to the nearest object that does implement it (WKAccessibilityWebPageObject).

Because we create and cache a lot of attributed strings in isolated tree mode, this iteration can be
a serious performance hit. This patch implements the method.

>From a sample taken on document editing website, 11k of 73k total samples are saved.

* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityPresenterProcessIdentifier]):
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformInitializeAccessibility):

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




More information about the webkit-changes mailing list