Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4e41032eeaa72757c1dc764b823f847482646dcd
https://github.com/WebKit/WebKit/commit/4e41032eeaa72757c1dc764b823f847482646dcd
Author: Andres Gonzalez <[email protected]>
Date: 2026-03-02 (Mon, 02 Mar 2026)
Changed paths:
A
LayoutTests/accessibility/mac/textarea-selected-text-changed-notifications-expected.txt
A
LayoutTests/accessibility/mac/textarea-selected-text-changed-notifications.html
M Source/WebCore/accessibility/AXObjectCache.cpp
Log Message:
-----------
AX: AXSelectedTextChanged notifications are posted before the isolated tree
is updated.
https://bugs.webkit.org/show_bug.cgi?id=308670
<rdar://problem/171203002>
Reviewed by Tyler Wilcock.
When postTextSelectionChangePlatformNotification fires, accessibility clients
(e.g. VoiceOver) handle the notification and query the isolated tree for the
current selected text marker range. However, onSelectedTextChanged — which
updates the isolated tree's selected text marker range — was being called
*after* the platform notification was posted. This meant clients could read
a stale selection from the isolated tree.
Fix this by moving the onSelectedTextChanged call to before
postTextSelectionChangePlatformNotification, so the isolated tree's selected
text marker range is already up-to-date when clients handle the notification.
Test: accessibility/mac/textarea-selected-text-changed-notifications.html
*
LayoutTests/accessibility/mac/textarea-selected-text-changed-notifications-expected.txt:
Added.
*
LayoutTests/accessibility/mac/textarea-selected-text-changed-notifications.html:
Added.
Before this change, this test would fail in ITM. With this change, it passes in
both ITM on and off.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postTextStateChangeNotification):
Canonical link: https://commits.webkit.org/308495@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications