Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4119898fe1bc0d49db3cb4e10674aaa21fc294ed
https://github.com/WebKit/WebKit/commit/4119898fe1bc0d49db3cb4e10674aaa21fc294ed
Author: Tyler Wilcock <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M LayoutTests/accessibility-isolated-tree/TestExpectations
A
LayoutTests/accessibility/isolated-tree/mac/replaced-element-line-index-hang-expected.txt
A
LayoutTests/accessibility/isolated-tree/mac/replaced-element-line-index-hang.html
M
LayoutTests/accessibility/mac/replaced-element-line-index-hang-expected.txt
M LayoutTests/accessibility/mac/replaced-element-line-index-hang.html
M Source/WebCore/accessibility/AccessibilityObject.cpp
Log Message:
-----------
AX: AXLineForTextMarker undercounts lines when an inline replaced element
gets a line of its own
https://bugs.webkit.org/show_bug.cgi?id=324572
rdar://187805860
Reviewed by Dominic Mazzoni.
For a narrow editable laying out one glyph per line with an image between them:
ABCDE<img width="20" height="20">FGHIJ
the image doesn't fit alongside a glyph, so it takes a line of its own (11
lines total).
AXLineForTextMarker answered 9 for a marker at the end of the value instead of
10, so VoiceOver
saw a line fewer than the field has. The isolated tree already answered 10, so
the two disagreed.
AccessibilityObject::lineForPosition counted previousLinePosition steps,
assuming each step
crosses exactly one line. But one step crosses two here, as the start of the
line after the image is
the very same VisiblePosition as the position after the image, since
Position::inlineBoxAndOffset
resolves a RenderBox at a soft-wrap boundary to that box without consulting
affinity. That position's
line box is the image's, so the step lands two lines up and the line between is
never counted.
Count the line boxes each step crosses instead of counting steps, falling back
to one line
when the two positions are in different blocks and their line boxes can't reach
each other.
* LayoutTests/accessibility-isolated-tree/TestExpectations: Remove failing test
expectation.
*
LayoutTests/accessibility/isolated-tree/mac/replaced-element-line-index-hang-expected.txt:
Copied from
LayoutTests/accessibility/mac/replaced-element-line-index-hang-expected.txt.
*
LayoutTests/accessibility/isolated-tree/mac/replaced-element-line-index-hang.html:
Copied from
LayoutTests/accessibility/mac/replaced-element-line-index-hang.html.
* LayoutTests/accessibility/mac/replaced-element-line-index-hang-expected.txt:
* LayoutTests/accessibility/mac/replaced-element-line-index-hang.html:
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::lineCountBetween):
(WebCore::AccessibilityObject::lineForPosition const):
Canonical link: https://commits.webkit.org/321505@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications