Skip to content

Commit

Permalink
Cherry-pick 4ca9919. rdar://122100786
Browse files Browse the repository at this point in the history
    AX: legend-children-are-visible.html, link-inside-button-accessible-text.html, and text-alternative-calculation-from-unrendered-table.html crash in ITM due to missing AXObjectCache nullptr checks
    https://bugs.webkit.org/show_bug.cgi?id=268552
    rdar://problem/122100786

    Reviewed by Chris Fleizach.

    Add these missing nullptr checks, and improve smart pointer usage in adjacent code.

    * Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
    (WebCore::AccessibilityNodeObject::radioButtonGroup const):
    (WebCore::accessibleNameForNode):

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

Canonical link: https://commits.webkit.org/272448.514@safari-7618.1.15-branch
Identifier: 272448.515@safari-7618-branch
  • Loading branch information
twilco authored and rjepstein committed Feb 8, 2024
1 parent 221cd4e commit 08e36dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2513,7 +2513,8 @@ static String accessibleNameForNode(Node* node, Node* labelledbyNode)

// If the node can be turned into an AX object, we can use standard name computation rules.
// If however, the node cannot (because there's no renderer e.g.) fallback to using the basic text underneath.
auto* axObject = node->document().axObjectCache()->getOrCreate(node);
auto* cache = node->document().axObjectCache();
RefPtr axObject = cache ? cache->getOrCreate(node) : nullptr;
if (axObject) {
String valueDescription = axObject->valueDescription();
if (!valueDescription.isEmpty())
Expand Down

0 comments on commit 08e36dd

Please sign in to comment.