Skip to content

Commit

Permalink
AX: AccessibilityNodeObject::ariaLabeledByText appends to a Vector th…
Browse files Browse the repository at this point in the history
…at it never uses

https://bugs.webkit.org/show_bug.cgi?id=246905
rdar://problem/101462816

Reviewed by Chris Fleizach.

In this commit:

f8283a7 (Removed unused textElements member from AccessibilityText structure)

We stopped using the local `axElements` Vector in AccessibilityNodeObject::ariaLabeledByText, but still build it for no reason.

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

Canonical link: https://commits.webkit.org/255890@main
  • Loading branch information
twilco committed Oct 23, 2022
1 parent 6ee1068 commit e081fcf
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Expand Up @@ -1829,19 +1829,8 @@ void AccessibilityNodeObject::accessibilityText(Vector<AccessibilityText>& textO
void AccessibilityNodeObject::ariaLabeledByText(Vector<AccessibilityText>& textOrder) const
{
String ariaLabeledBy = ariaLabeledByAttribute();
if (!ariaLabeledBy.isEmpty()) {
auto objectCache = axObjectCache();
if (!objectCache)
return;

auto elements = ariaLabeledByElements();

Vector<AXCoreObject*> axElements;
for (const auto& element : elements)
axElements.append(objectCache->getOrCreate(element));

if (!ariaLabeledBy.isEmpty())
textOrder.append(AccessibilityText(ariaLabeledBy, AccessibilityTextSource::Alternative));
}
}

String AccessibilityNodeObject::alternativeTextForWebArea() const
Expand Down

0 comments on commit e081fcf

Please sign in to comment.