[webkit-changes] [WebKit/WebKit] 64cb7c: AX: Cache AttributedStrings for static text isolat...

AndresGonzalezApple noreply at github.com
Tue Mar 14 13:48:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 64cb7c2d3fe3c312cb8167b5cd803e51eed2498f
      https://github.com/WebKit/WebKit/commit/64cb7c2d3fe3c312cb8167b5cd803e51eed2498f
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm

  Log Message:
  -----------
  AX: Cache AttributedStrings for static text isolated objects.
https://bugs.webkit.org/show_bug.cgi?id=253864
<rdar://problem/106676049>

Reviewed by Tyler Wilcock.

Added caching of AttributedStrings for static text isolated objects. This reduces amount of hits to the main thread to retrieve related properties. Notice that this is done for inline static text objects, not for ARIA declared static text objects. In addition, avoid duplicating the StringValue text when it can be obtained from the attributed text.
In an aside, removed passing the IsRoot parameter to AXIsolatedObject::initializeProperties and initializePlatformProperties since it is not necessary.

* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm:
(WebCore::AccessibilityObject::attributedStringForTextMarkerRange const):
(WebCore::AccessibilityObject::attributedStringForRange const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
(WebCore::AXIsolatedObject::stringValue const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::initializePlatformProperties):
(WebCore::AXIsolatedObject::platformStringValue const):
(WebCore::shouldCacheAttributedText):

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




More information about the webkit-changes mailing list