Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7d16beecc9de537e21bbde70757f32ccc0396d45
https://github.com/WebKit/WebKit/commit/7d16beecc9de537e21bbde70757f32ccc0396d45
Author: Tyler Wilcock <[email protected]>
Date: 2026-06-15 (Mon, 15 Jun 2026)
Changed paths:
M LayoutTests/accessibility-isolated-tree/TestExpectations
A LayoutTests/accessibility/mac/empty-document-text-markers-expected.txt
A LayoutTests/accessibility/mac/empty-document-text-markers.html
M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Log Message:
-----------
AX: AXStartTextMarker should return the first text position in the document,
but the isolated tree implementation does not do that
https://bugs.webkit.org/show_bug.cgi?id=317057
rdar://179539024
Reviewed by Chris Fleizach and Dominic Mazzoni.
In isolated tree mode, the AXStartTextMarker handler returned
AXIsolatedTree::firstMarker() directly,
which is the {WebArea, 0} container marker. The live path returns
textMarkerForVisiblePosition(startOfDocument),
whose TextMarkerData carries the first text node, so the live start marker is
text-anchored.
This asymmetry means AXUIElementForTextMarker resolves the isolated start
marker to the
WebArea, while the end marker (already text-anchored via
lastMarker().findLast()) resolves
to a text element.
Resolve the start marker to its first text-run position with
firstMarker().toTextRunMarker(),
matching the live startOfDocument path and the end marker's findLast().
For a text-less document toTextRunMarker() finds no runs and returns a null
marker, so fall
back to the container marker (isValid() guard), where the live path still
yields a valid start
marker. New test accessibility/mac/empty-document-text-markers.html verifies
this.
This also fixes these tests when run with isolated tree mode:
- accessibility/search-misspellings.html
- text-stitching-end-text-marker.html
* LayoutTests/accessibility-isolated-tree/TestExpectations:
* LayoutTests/accessibility/mac/empty-document-text-markers-expected.txt: Added.
* LayoutTests/accessibility/mac/empty-document-text-markers.html: Added.
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(handleStartTextMarkerAttribute):
Canonical link: https://commits.webkit.org/315238@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications