Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: afbed57136bc0cfb4a4e6254d02e16d4f3953619
      
https://github.com/WebKit/WebKit/commit/afbed57136bc0cfb4a4e6254d02e16d4f3953619
  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/textmarker-range-for-range-expected.txt
    A 
LayoutTests/accessibility/isolated-tree/mac/textmarker-range-for-range.html
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm

  Log Message:
  -----------
  AX: In isolated tree mode, AXTextMarkerRangeForNSRange loses two positions at 
every paragraph boundary
https://bugs.webkit.org/show_bug.cgi?id=324629
rdar://187883723

Reviewed by Dominic Mazzoni and Chris Fleizach.

Asking a group that spans two paragraphs for the marker range of NSRange (0, 
i), for each i up to
the length of its text, drifted two characters ahead of the main thread at the 
first paragraph
boundary and never recovered, running out of text four indices early.

textMarkerRangeForNSRange has a fast path that treats the NSRange as offsets 
into textContent(),
which is what textMarkerRange().toString() produces, so it includes the 
newlines emitted at block
boundaries. It then builds markers anchored on this object carrying those 
offsets, but a marker's
offset indexes its object's text runs, which don't include those newlines. Take 
the fast path only
when this object holds all of that text itself, so the two spaces provably 
coincide, and let
anything spanning a block boundary take the walk below, which counts them.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
* 
LayoutTests/accessibility/isolated-tree/mac/textmarker-range-for-range-expected.txt:
 Added.
* LayoutTests/accessibility/isolated-tree/mac/textmarker-range-for-range.html: 
Added.
* Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::textMarkerRangeForNSRange const):

Canonical link: https://commits.webkit.org/321504@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to