Skip to content

Commit

Permalink
AX: Voice Control cannot access any web content
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=259951
rdar://113280724

Reviewed by Chris Fleizach.

This is a regression from https://bugs.webkit.org/show_bug.cgi?id=256238, which changed
`-[WKAccessibilityWebPageObjectMac accessibilityAttributeNames]` to return `m_attributeNames`
via `.autorelease()` rather than `.get()`. Returning via autorelease causes the backing NSArray
to be released after the next iteration of the runloop, meaning subsequent requests to
`accessibilityAttributeNames` return nil. Voice Control relies on this output being correct to function.

With this patch, both `m_attributeNames` and `m_parameterizedAttributeNames` are returned via
`RetainPtr::get()`, preventing their early deletion. This matches the getters for other
`RetainPtr<NSArray> m_foo` types throughout WebKit.

* Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):

Canonical link: https://commits.webkit.org/266714@main
  • Loading branch information
twilco committed Aug 9, 2023
1 parent 4d76982 commit ff720c4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ - (BOOL)accessibilityIsIgnored
- (NSArray *)accessibilityAttributeNames
ALLOW_DEPRECATED_IMPLEMENTATIONS_END
{
return m_attributeNames.autorelease();
return m_attributeNames.get();
}

ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN
- (NSArray *)accessibilityParameterizedAttributeNames
ALLOW_DEPRECATED_IMPLEMENTATIONS_END
{
return m_parameterizedAttributeNames.autorelease();
return m_parameterizedAttributeNames.get();
}

ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN
Expand Down

0 comments on commit ff720c4

Please sign in to comment.