AX: Some places in accessibility traverse through VisiblePositions without checking progress was made, meaning we can loop forever#63268
Merged
Conversation
Collaborator
|
EWS run on current version of this PR (hash e3ff0ef) Details
|
hoffmanjoshua
approved these changes
Apr 21, 2026
…thout checking progress was made, meaning we can loop forever https://bugs.webkit.org/show_bug.cgi?id=312932 rdar://175280603 Reviewed by Joshua Hoffman. In 311153@main we fixed three while-loops in AccessibilityObject.cpp where VisiblePosition::next() or previous() could return the same position, causing an infinite loop and permanently hanging the main-thread. This change applies the same defensive pattern to five additional loops that have the same vulnerability: 1. leftLineVisiblePositionRange: previous() loop without progress check 2. rightLineVisiblePositionRange: next() loop without progress check 3. updateAXLineStartForVisiblePosition: while(true) with previous() and no stuck-position guard 4. characterOffsetFromVisiblePosition: nextVisuallyDistinctCandidate loop with no guard despite comments acknowledging the risk 5. characterOffsetForBounds: bidirectional CharacterOffset iteration with no stuck-position check * LayoutTests/accessibility/left-right-line-range-display-table-in-flex-expected.txt: Added. * LayoutTests/accessibility/left-right-line-range-display-table-in-flex.html: Added. * LayoutTests/platform/glib/TestExpectations: * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::characterOffsetFromVisiblePosition): (WebCore::AXObjectCache::characterOffsetForBounds): * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::updateAXLineStartForVisiblePosition): (WebCore::AccessibilityObject::leftLineVisiblePositionRange const): (WebCore::AccessibilityObject::rightLineVisiblePositionRange const): Canonical link: https://commits.webkit.org/311749@main
e3ff0ef to
57b2f8d
Compare
Collaborator
|
Committed 311749@main (57b2f8d): https://commits.webkit.org/311749@main Reviewed commits have been landed. Closing PR #63268 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.
57b2f8d
e3ff0ef
🧪 win-tests🧪 api-mac-debug