[webkit-changes] [WebKit/WebKit] a8f281: AX: NULL attributed string returned for text marke...

Joshua Hoffman noreply at github.com
Tue Mar 5 08:51:06 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a8f281f89e750d8fea2e45ce43f2a955f989543b
      https://github.com/WebKit/WebKit/commit/a8f281f89e750d8fea2e45ce43f2a955f989543b
  Author: Joshua Hoffman <jhoffman23 at apple.com>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    A LayoutTests/accessibility/mac/selected-text-range-unconnected-object.html
    A LayoutTests/platform/mac/accessibility/mac/selected-text-range-unconnected-object-expected.txt
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h

  Log Message:
  -----------
  AX: NULL attributed string returned for text markers that contain unconnected nodes
https://bugs.webkit.org/show_bug.cgi?id=270499
rdar://122451549

Reviewed by Tyler Wilcock.

If a node is unconnected and we queue up a node change for it, nothing will happen, since
shouldCreateNodeChange will return false. This means that if we request a text marker range
that points to a stale, unconnected node, we may get a null attributed string since the range
being requested is invalid.

This change adds a new condition to shouldCreateNodeChange for unconnected nodes, and adds a
new test to verify this behavior.

* LayoutTests/accessibility/mac/selected-text-range-unconnected-object.html: Added.
* LayoutTests/platform/mac/accessibility/mac/selected-text-range-unconnected-object-expected.txt: Added.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::shouldCreateNodeChange):
(WebCore::AXIsolatedTree::addUnconnectedNode):
(WebCore::AXIsolatedTree::removeSubtreeFromNodeMap):
(WebCore::shouldCreateNodeChange): Deleted.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:

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



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


More information about the webkit-changes mailing list