Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0556b61ecd863c668fe5442d27f06c87b16195fb
      
https://github.com/WebKit/WebKit/commit/0556b61ecd863c668fe5442d27f06c87b16195fb
  Author: Andres Gonzalez <[email protected]>
  Date:   2026-07-01 (Wed, 01 Jul 2026)

  Changed paths:
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
    M Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
    M Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm

  Log Message:
  -----------
  AX: Expose the line number for a character index on the iOS accessibility 
wrapper.
https://bugs.webkit.org/show_bug.cgi?id=318346
<rdar://problem/181133129>

Reviewed by Tyler Wilcock.

macOS VoiceOver asks for the line number containing a character index via the
AXLineForIndex parameterized attribute. WebCore already answers this on macOS
(handleParamLineForIndexAttribute in WebAccessibilityObjectWrapperMac.mm, backed
by AccessibilityObject::doAXLineForIndex), but the iOS accessibility wrapper had
no equivalent, so a client on iOS could only reconstruct the line number by
walking line ranges. This matters for Catalyst apps whose web content reaches
macOS VoiceOver through the iOS-to-macOS platform translation: without a
line-number-for-index attribute the translation has to synthesize the number by
hopping AXTextLineRangeForPosition in the app process rather than reading it 
from
the render tree.

This patch adds -[WebAccessibilityObjectWrapper lineNumberForIndex:], computed 
in
the web process via doAXLineForIndex, returning nil when the element exposes no
line geometry (mirroring the macOS handler, which maps a negative line to a
missing value). Unlike the macOS registration it is not gated on the element
being a text control, so static text such as wrapped article paragraphs is
covered too.

Enabled the existing cross-platform test 
accessibility/textarea-line-for-index.html
on iOS. It previously ran only on macOS because the iOS DumpRenderTree and
WebKitTestRunner accessibility elements stubbed lineForIndex to return -1; both
now forward to the new lineNumberForIndex: selector, mapping a missing value 
back
to -1 to match the macOS runner. The test is re-enabled over the iOS 
accessibility
directory skip in platform/ios/TestExpectations and reuses the shared expected
result.

* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper lineNumberForIndex:]):
* Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::lineForIndex):
* Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElementIOS::lineForIndex):

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



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

Reply via email to