[webkit-changes] [WebKit/WebKit] b5d87f: AX: ASSERT crash in [WebAccessibilityObjectWrapper...

AndresGonzalezApple noreply at github.com
Fri Jul 12 14:38:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b5d87f4d51050d8d9c707ab58de6f5f4c890d5e9
      https://github.com/WebKit/WebKit/commit/b5d87f4d51050d8d9c707ab58de6f5f4c890d5e9
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2024-07-12 (Fri, 12 Jul 2024)

  Changed paths:
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: ASSERT crash in [WebAccessibilityObjectWrapper attributedStringForNSRange:].
https://bugs.webkit.org/show_bug.cgi?id=276264
<rdar://problem/131185541>

Reviewed by Tyler Wilcock.

Covered by test accessibility/native-text-control-attributed-string.html.

When attributedStringForNSRange is passed an out of range NSRange, the return value is a null AXTextMrkerRange. Before, we were calling attributedStringForTextMarkerRange passing the null AXTextMarkerRange, which can lead to map look ups with an invalid AXID and hence the ASSERT crash. Despite the stopgap check upper in the stack for a valid AXID, to avoid this case in the future, this fix early-returns in the wrapper call when the NSRange yields a null AXTextMarkerRange.

This change has the additional improvement of making attributedStringForNSRange a helper function that takes the backing object as a parameter instead of calling [self axBackingObject] which has proven to be a bottleneck in some of the WebContent process samples.

* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(attributedStringForNSRange):
(rtfForNSRange):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper attributedStringForNSRange:]): Now a static function.
(-[WebAccessibilityObjectWrapper rtfForNSRange:]): Now a static function.

Canonical link: https://commits.webkit.org/280920@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