AX: Bound all indefinite-blocking main-thread retrieval calls from the accessibility thread with timeouts#64519
Merged
Conversation
Collaborator
|
EWS run on current version of this PR (hash 60729d3) Details
|
minorninth
approved these changes
May 8, 2026
…e 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
60729d3 to
ab00c2f
Compare
Collaborator
|
Committed 312880@main (ab00c2f): https://commits.webkit.org/312880@main Reviewed commits have been landed. Closing PR #64519 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ab00c2f
60729d3
🛠 win🧪 win-tests🧪 mac-intel-wk2