Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7ae09634f2abe7e46359da8c5b73fe3c891118b9
https://github.com/WebKit/WebKit/commit/7ae09634f2abe7e46359da8c5b73fe3c891118b9
Author: Tyler Wilcock <[email protected]>
Date: 2026-04-28 (Tue, 28 Apr 2026)
Changed paths:
A LayoutTests/accessibility/attributed-string-for-line-in-table-expected.txt
A LayoutTests/accessibility/attributed-string-for-line-in-table.html
M LayoutTests/platform/glib/TestExpectations
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/accessibility/AXObjectCache.cpp
M Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm
Log Message:
-----------
AX: On macOS, attributedStringForTextMarkerRange returns empty string for
line ranges spanning nested table boundaries
https://bugs.webkit.org/show_bug.cgi?id=313508
rdar://174349841
Reviewed by Joshua Hoffman.
On macOS, attributedStringForTextMarkerRange used rangeForTextMarkerRange()
to convert text markers to a SimpleRange via CharacterOffset. This path
relies on characterOffsetsInOrder() to determine ordering, which produces
incorrect results for positions spanning across nested table boundaries
(e.g. a text node inside a cell vs. an ancestor tbody position). The
reversed range caused attributedStringForTextMarkerRange to return an
empty string, making VoiceOver read "new line" instead of the actual
line content.
Fix this by matching iOS and switching to simpleRange(), which converts
directly from the text markers' boundary points.
This commit does not address the core bug causing the reversed range. I
attempted to do this, but it ended up being complex, so a FIXME was added
instead.
This commit is still a good step forward, decreasing the difference between
platforms
and introducing a layout test that reproduces the issue.
* LayoutTests/accessibility/attributed-string-for-line-in-table-expected.txt:
Added.
* LayoutTests/accessibility/attributed-string-for-line-in-table.html: Added.
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::characterOffsetsInOrder):
* Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm:
(WebCore::AccessibilityObject::attributedStringForTextMarkerRange const):
Canonical link: https://commits.webkit.org/312263@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications