Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ef43e42c5970c6e8ee6423edf077d79829b00867
      
https://github.com/WebKit/WebKit/commit/ef43e42c5970c6e8ee6423edf077d79829b00867
  Author: Joshua Hoffman <jhoffma...@apple.com>
  Date:   2023-11-16 (Thu, 16 Nov 2023)

  Changed paths:
    M Source/WebCore/accessibility/AXCoreObject.cpp
    M Source/WebCore/accessibility/AXCoreObject.h
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    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/AXIsolatedTree.h
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm

  Log Message:
  -----------
  accAX: Cache accessibilityText to serve Title, Description, Help Text 
attributes off of the main thread
https://bugs.webkit.org/show_bug.cgi?id=264642
rdar://118255218

Reviewed by Tyler Wilcock.

When the title, description, or help text attributes are requested for an AX 
element for the first time,
they are currently served on the main thread. To reduce this main thread 
dependency, this patch lazily
caches accessibilityText instead of the three attributes individually.

Caching accessibilityText allows us to compute the values for title, 
description, and help text on the
AX thread. This also allows us to move the implementations for these methods to 
AXCoreObject, so that
they can be shared between the live and isolated trees. We also benefit from 
caching AccessibilityText
by eliminating the redundant work within title, description, and help text 
separately.

Our old implementation of titleAttributeValue used textUnderElement() for 
calculating the title
of summary elements. We do not cache this, so instead, the implementation of 
visibleText was
modified to expose summary's visible text.

* Source/WebCore/accessibility/AXCoreObject.cpp:
(WebCore::isVisibleText):
(WebCore::isDescriptiveText):
(WebCore::AXCoreObject::descriptionAttributeValue const):
(WebCore::AXCoreObject::titleAttributeValue const):
(WebCore::AXCoreObject::helpTextAttributeValue const):
* Source/WebCore/accessibility/AXCoreObject.h:
(WebCore::AccessibilityText::AccessibilityText):
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::visibleText const):
* Source/WebCore/accessibility/AccessibilityObject.h:
(WebCore::AccessibilityText::AccessibilityText): Deleted.
* Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm:
(WebCore::isVisibleText): Deleted.
(WebCore::isDescriptiveText): Deleted.
(WebCore::AccessibilityObject::descriptionAttributeValue const): Deleted.
(WebCore::AccessibilityObject::titleAttributeValue const): Deleted.
(WebCore::AccessibilityObject::helpTextAttributeValue const): Deleted.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
(WebCore::AXIsolatedObject::fileUploadButtonReturnsValueInTitle const):
(WebCore::AXIsolatedObject::getOrRetrievePropertyValue):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
* Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::descriptionAttributeValue const): Deleted.
(WebCore::AXIsolatedObject::helpTextAttributeValue const): Deleted.
(WebCore::AXIsolatedObject::titleAttributeValue const): Deleted.

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to