Bug 231231

Summary: AX: Move handling of AXContents from platform wrapper to AX core
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=231289
Attachments:
Description Flags
Patch none

Description Tyler Wilcock 2021-10-05 07:18:59 PDT
Moving this means we'll be able to use this logic in core.
Comment 1 Radar WebKit Bug Importer 2021-10-05 07:19:09 PDT
<rdar://problem/83884806>
Comment 2 Tyler Wilcock 2021-10-05 14:16:51 PDT
Created attachment 440266 [details]
Patch
Comment 3 Tyler Wilcock 2021-10-05 14:20:13 PDT
Comment on attachment 440266 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440266&action=review

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:-2384
> -        // The contents of a tab list are all the children except the tabs.

The comment says this, but then the code that follows does the exact opposite thing. I elected to copy the current behavior when I moved this logic to AccessibilityObject.cpp.
Comment 4 EWS 2021-10-05 22:40:14 PDT
Committed r283601 (242553@main): <https://commits.webkit.org/242553@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440266 [details].
Comment 5 Andres Gonzalez 2021-10-06 07:00:47 PDT
(In reply to Tyler Wilcock from comment #2)
> Created attachment 440266 [details]
> Patch

--- a/Source/WebCore/accessibility/AccessibilityObjectInterface.h
+++ a/Source/WebCore/accessibility/AccessibilityObjectInterface.h

+    virtual void contents(AccessibilityChildrenVector&) = 0;

Should be 

virtual AccessibilityChildrenVector contents() = 0;

No need to pass an out parameter. Out parameters are bad and make client code less clear unnecessarily.

Also, can we make this method const:

virtual AccessibilityChildrenVector contents() const = 0;

or some of the function calls in the implementation cannot be const.
Comment 6 Andres Gonzalez 2021-10-06 07:17:17 PDT
(In reply to Tyler Wilcock from comment #2)
> Created attachment 440266 [details]
> Patch

--- a/Source/WebCore/accessibility/AccessibilityObject.cpp
+++ a/Source/WebCore/accessibility/AccessibilityObject.cpp

+        for (RefPtr<AccessibilityObject> child = firstChild(); child; child = child->nextSibling()) {

Change RefPtr<AccessibilityObject> to auto*
Comment 7 Tyler Wilcock 2021-10-06 07:32:35 PDT
Handling review comments in: https://bugs.webkit.org/show_bug.cgi?id=231289
Comment 8 Tyler Wilcock 2021-10-06 07:38:46 PDT
> Also, can we make this method const:

Unfortunately not, because tabChildren is not const.