Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 158ad8435dde123aa74d956efebb8d2a0ab230cb
      
https://github.com/WebKit/WebKit/commit/158ad8435dde123aa74d956efebb8d2a0ab230cb
  Author: Tyler Wilcock <[email protected]>
  Date:   2025-04-16 (Wed, 16 Apr 2025)

  Changed paths:
    M LayoutTests/accessibility-isolated-tree/TestExpectations
    M Source/WebCore/accessibility/AXTextMarker.cpp

  Log Message:
  -----------
  AX: After ENABLE(AX_THREAD_TEXT_APIS), passing the indexForTextMarker(foo) to 
textMarkerForIndex doesn't return the same marker, making them logically 
inconsistent
https://bugs.webkit.org/show_bug.cgi?id=291631
rdar://149389130

Reviewed by Joshua Hoffman.

Prior to this commit, imagining you have an `AXTextMarker` called |foo|, if you 
passed |foo| to a
NSAccessibilityIndexForTextMarkerAttribute request, and then immediately took 
that index and used it for a
NSAccessibilityTextMarkerForIndexAttribute request, you'd get back a different 
marker.

This happened because AXTextMarker::nextMarkerFromOffset(unsigned) used the 
form of AXTextMarker::findMarker that
"coalesces" object breaks, meaning that when the traversal moves from the end 
of one text object to a new one, it
starts at offset 1 to avoid doubly-representing the same position (the end of 
one text and the start of another can be
considered the same position).

However, we do not want this behavior for the textmarker-for-index and 
index-for-textmarker APIs. Our implementation of
index-for-textmarker correctly does not coalesce object breaks, but our 
implementation of textmarker-for-index
(AXTextMarker::nextMarkerFromOffset(unsigned)) did, making them logically 
inconsistent. This commit fixes the issue
by making AXTextMarker::nextMarkerFromOffset(unsigned) not coalesce object 
breaks, matching the main-thread text marker
implementation and fixing accessibility/mac/textmarker-routines.html in ITM.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
Remove failing expectation for accessibility/mac/textmarker-routines.html.
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::AXTextMarker::nextMarkerFromOffset const):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to