Bug 231231 - AX: Move handling of AXContents from platform wrapper to AX core
Summary: AX: Move handling of AXContents from platform wrapper to AX core
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-05 07:18 PDT by Tyler Wilcock
Modified: 2021-10-06 08:05 PDT (History)
10 users (show)

See Also:


Attachments
Patch (8.58 KB, patch)
2021-10-05 14:16 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.