Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5fd9a4304b881e29883ec2d31858386440f7e39a
https://github.com/WebKit/WebKit/commit/5fd9a4304b881e29883ec2d31858386440f7e39a
Author: Andres Gonzalez <[email protected]>
Date: 2026-07-06 (Mon, 06 Jul 2026)
Changed paths:
A
LayoutTests/accessibility/mac/stitched-text-marker-range-for-ui-element-expected.txt
A
LayoutTests/accessibility/mac/stitched-text-marker-range-for-ui-element.html
M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm
Log Message:
-----------
AX: A text-stitch-group representative's text marker range is truncated to
its first run
https://bugs.webkit.org/show_bug.cgi?id=318529
<rdar://problem/181299126>
Reviewed by Dominic Mazzoni.
When accessibility text stitching merges adjacent text runs into a single
static-text
representative, the representative's value spans all of its members, but its
text marker
range did not. On the isolated tree, AXIsolatedObject::textMarkerRange() used
the stitch
group only to pick a stop boundary and then derived the range endpoints by
walking the
accessibility tree, a walk that stops at the representative's own run. As a
result
AXTextMarkerRangeForUIElement, and the string, attributed-string, and length
APIs derived
from that range, returned only the first run (e.g. "By" of a stitched "By JOHN
GRUBER")
rather than the full stitched text, so a client that reads an element's text
through its
marker range got truncated content that disagreed with the element's value.
Build the representative's range directly from its stitch-group members, from
the first
through the last member that has text runs, mirroring the main-thread
AccessibilityObject::simpleRange(). This spans the full stitched text and is
consistent
with stringValue() and relativeFrame(), which already iterate the members.
Test: accessibility/mac/stitched-text-marker-range-for-ui-element.html
*
LayoutTests/accessibility/mac/stitched-text-marker-range-for-ui-element-expected.txt:
Added.
* LayoutTests/accessibility/mac/stitched-text-marker-range-for-ui-element.html:
Added.
* Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::textMarkerRange const): Build a stitch-group
representative's
range from its members instead of a tree walk that stops at the first run.
Canonical link: https://commits.webkit.org/316576@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications