Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3809a67b854d775397ce4b455fdb8c622843db3c
      
https://github.com/WebKit/WebKit/commit/3809a67b854d775397ce4b455fdb8c622843db3c
  Author: Tyler Wilcock <tyle...@apple.com>
  Date:   2025-03-01 (Sat, 01 Mar 2025)

  Changed paths:
    M LayoutTests/accessibility-isolated-tree/TestExpectations
    M LayoutTests/accessibility/mac/input-type-change-crash-expected.txt
    A 
LayoutTests/accessibility/mac/text-marker-from-typing-notification-expected.txt
    A LayoutTests/accessibility/mac/text-marker-from-typing-notification.html
    M LayoutTests/platform/mac-wk1/TestExpectations
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXTextMarker.cpp
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
    M Tools/WebKitTestRunner/InjectedBundle/cocoa/AccessibilityCommonCocoa.mm

  Log Message:
  -----------
  AX: Immediately queue changes to AXProperty::TextRuns as part of the next 
tree snapshot so we have the right tree state in response to text markers 
generated from typing in an editable field
https://bugs.webkit.org/show_bug.cgi?id=288845
rdar://145865930

Reviewed by Chris Fleizach.

When a user types, this happens:

 1. AXObjectCache::onTextRunsChanged gets called.

 2. We send out a AXValueChanged notification that includes a text marker with 
an offset pointing to
    the end of the changed text. Before sending the notification, we 
processQueuedNodeUpdates() to
    ensure we queue up isolated tree updates representing the new state of the 
page, so that if an AT
    responds immediately with the text marker we gave it, we are working off 
the latest information.

The problem is that, prior to this commit, AXObjectCache::onTextRunsChanged 
used AXObjectCache::postNotification to
queue the text runs update, which critically is not covered by 
processQueuedNodeUpdates. This means that if an AT
immediately responded with the text marker, we would not yet have updated the 
text runs, and thus behave incorrectly.

To fix this, this commit changes AXObjectCache::onTextRunsChanged to use 
AXObjectCache::updateIsolatedTree, which
immediately queues up a property update for use by processQueuedNodeUpdates().

Long term, we should switch everything over to being processed by 
processQueuedNodeUpdates(), guaranteeing we are
always pushing consistent snapshots of the tree.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
Note the ITM workaround made in the new test.
* 
LayoutTests/accessibility/mac/text-marker-from-typing-notification-expected.txt:
 Added.
* LayoutTests/accessibility/mac/text-marker-from-typing-notification.html: 
Added.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::onTextRunsChanged):
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::AXTextMarker::toTextRunMarker const):

* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(isValueTypeSupported):
* Tools/WebKitTestRunner/InjectedBundle/cocoa/AccessibilityCommonCocoa.mm:
(WTR::makeValueRefForValue):
Enable support for passing text markers in `userInfo` notifications sent
to layout tests.

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



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

Reply via email to