Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ab00c2fa50938db2ffd3be24d06aad97bbf2b166
      
https://github.com/WebKit/WebKit/commit/ab00c2fa50938db2ffd3be24d06aad97bbf2b166
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-05-08 (Fri, 08 May 2026)

  Changed paths:
    M Source/WebCore/accessibility/AXCoreObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: Bound all indefinite-blocking main-thread retrieval calls from the 
accessibility thread with timeouts
https://bugs.webkit.org/show_bug.cgi?id=314367
rdar://176524311

Reviewed by Dominic Mazzoni.

retrieveAutoreleasedValueFromMainThread and retrieveValueFromMainThread block
the AX thread forever via callOnMainThreadAndWait if the main thread is busy
(e.g. long-running JS, layout, synchronous IPC). This can cause assistive
technologies to hang waiting for responses that never come.

Convert all unguarded call sites in WebAccessibilityObjectWrapperMac to use
retrieveValueFromMainThreadWithTimeout (or the WithDefault variant), returning
nil on timeout.

For three operations (text marker for position, start/end text marker for
bounds), add approximate-hit-test fallbacks: when the main thread times out,
use AXIsolatedObject::approximateHitTest to find the element at the relevant
point and return the start/end of its text marker range. This provides a
potentially less accurate, but usable result rather than nothing.

Make AXIsolatedObject::approximateHitTest public so the wrapper can call it
directly for these fallbacks without going through accessibilityHitTest (which
would redundantly attempt the main thread again).

* Source/WebCore/accessibility/AXCoreObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper attachmentView]):
(-[WebAccessibilityObjectWrapper _associatedPluginParentWith:]):
(handleLineRectsAndTextAttribute):
(-[WebAccessibilityObjectWrapper 
_accessibilityHitTest:returnPlatformElements:]):
(handleSelectTextWithCriteriaAttribute):
(handleSearchTextWithCriteriaAttribute):
(handleTextOperationAttribute):
(handleEndTextMarkerForBoundsAttribute):
(handleStartTextMarkerForBoundsAttribute):
(handleMisspellingTextMarkerRangeAttribute):
(handleTextMarkerForPositionAttribute):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to