Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c1d6a750aaecddc7141e4becc6273adcd71baef3
      
https://github.com/WebKit/WebKit/commit/c1d6a750aaecddc7141e4becc6273adcd71baef3
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-09-05 (Sat, 05 Sep 2026)

  Changed paths:
    M LayoutTests/accessibility-isolated-tree/TestExpectations
    M LayoutTests/accessibility/textarea-insertion-point-line-number.html
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/AXTextMarker.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp

  Log Message:
  -----------
  AX: In isolated tree mode, the insertion point line number is wrong when the 
caret is in a text control nested in a contenteditable
https://bugs.webkit.org/show_bug.cgi?id=323508
rdar://186747828

Reviewed by Chris Fleizach.

AXInsertionPointLineNumber answers for the control it is asked of, so its line 
count has to start at
that control. The isolated tree instead let AXTextMarker::lineIndex pick a 
root, which is the marker's
nearest editable ancestor. When a text control holds the caret, that ancestor 
is the nested control
rather than the contenteditable being asked, so the count restarted inside it 
and reported line 0 for
a caret on the contenteditable's second line.

Let a caller name the root to count from, and have insertionPointLineNumber 
pass itself. Asking the
nested textarea directly still answers 0, which is what the last check in the 
test covers.

The test required some fixes too, as it did not accurately represent real AT 
behavior. It set the DOM
selection and read the insertion point in the same turn, and accessibility only 
learns about a selection
change from a notification, so in isolated tree mode all three reads saw the 
selection as it stood before
the first one -- the notification for the whole sequence arrives afterwards. 
Now we wait for the
notification as an AT would.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
Mark accessibility/textarea-insertion-point-line-number.html as fixed.
* LayoutTests/accessibility/textarea-insertion-point-line-number.html:
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::AXTextMarker::lineIndex const):
* Source/WebCore/accessibility/AXTextMarker.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::insertionPointLineNumber const):

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



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

Reply via email to