Bug 214202 - AX: Build failure for catalyst
Summary: AX: Build failure for catalyst
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-10 14:57 PDT by chris fleizach
Modified: 2020-07-10 16:16 PDT (History)
9 users (show)

See Also:


Attachments
patch (1.87 KB, patch)
2020-07-10 15:02 PDT, chris fleizach
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2020-07-10 14:57:37 PDT
./accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1512:12: error: cannot initialize return object of type 'BOOL' (aka 'signed char') with an rvalue of type 'WebCore::AXCoreObject *'
    return Accessibility::findAncestor<AXCoreObject>(*self.axBackingObject, false, [] (const AXCoreObject& object) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1522:12: error: cannot initialize return object of type 'BOOL' (aka 'signed char') with an rvalue of type 'WebCore::AXCoreObject *'
Comment 1 Radar WebKit Bug Importer 2020-07-10 14:57:48 PDT
<rdar://problem/65366125>
Comment 2 chris fleizach 2020-07-10 15:02:37 PDT
Created attachment 404006 [details]
patch
Comment 3 zalan 2020-07-10 15:11:32 PDT
wouldn't !(!) work here as well?
Comment 4 chris fleizach 2020-07-10 15:36:30 PDT
(In reply to zalan from comment #3)
> wouldn't !(!) work here as well?

I think so but isn't comparing against nullptr more clear?
Comment 5 EWS 2020-07-10 15:42:20 PDT
Committed r264243: <https://trac.webkit.org/changeset/264243>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404006 [details].
Comment 6 zalan 2020-07-10 15:45:35 PDT
(In reply to chris fleizach from comment #4)
> (In reply to zalan from comment #3)
> > wouldn't !(!) work here as well?
> 
> I think so but isn't comparing against nullptr more clear?
WebKit prefers it the other way around (instead of [if (foo != nullptr)] we usually go like [if (!foo)])
Comment 7 chris fleizach 2020-07-10 15:50:24 PDT
(In reply to zalan from comment #6)
> (In reply to chris fleizach from comment #4)
> > (In reply to zalan from comment #3)
> > > wouldn't !(!) work here as well?
> > 
> > I think so but isn't comparing against nullptr more clear?
> WebKit prefers it the other way around (instead of [if (foo != nullptr)] we
> usually go like [if (!foo)])

So in this case you think

return !(!Accessibility::findAncestor<AXCoreObject>(*self.axBackingObject, false, [] (const AXCoreObject& object) {
        return object.roleValue() == AccessibilityRole::DescriptionListTerm;
}));

would be better suited?
Comment 8 zalan 2020-07-10 15:55:23 PDT
(In reply to chris fleizach from comment #7)
> (In reply to zalan from comment #6)
> > (In reply to chris fleizach from comment #4)
> > > (In reply to zalan from comment #3)
> > > > wouldn't !(!) work here as well?
> > > 
> > > I think so but isn't comparing against nullptr more clear?
> > WebKit prefers it the other way around (instead of [if (foo != nullptr)] we
> > usually go like [if (!foo)])
> 
> So in this case you think
> 
> return !(!Accessibility::findAncestor<AXCoreObject>(*self.axBackingObject,
> false, [] (const AXCoreObject& object) {
>         return object.roleValue() == AccessibilityRole::DescriptionListTerm;
> }));
> 
> would be better suited?
Yeah, I would change it to !!Accessibility::findAncestor as a drive-by fix whenever you make some changes in here.
Comment 9 chris fleizach 2020-07-10 16:16:16 PDT
(In reply to zalan from comment #8)
> (In reply to chris fleizach from comment #7)
> > (In reply to zalan from comment #6)
> > > (In reply to chris fleizach from comment #4)
> > > > (In reply to zalan from comment #3)
> > > > > wouldn't !(!) work here as well?
> > > > 
> > > > I think so but isn't comparing against nullptr more clear?
> > > WebKit prefers it the other way around (instead of [if (foo != nullptr)] we
> > > usually go like [if (!foo)])
> > 
> > So in this case you think
> > 
> > return !(!Accessibility::findAncestor<AXCoreObject>(*self.axBackingObject,
> > false, [] (const AXCoreObject& object) {
> >         return object.roleValue() == AccessibilityRole::DescriptionListTerm;
> > }));
> > 
> > would be better suited?
> Yeah, I would change it to !!Accessibility::findAncestor as a drive-by fix
> whenever you make some changes in here.

Noted