Bug 214202

Summary: AX: Build failure for catalyst
Product: WebKit Reporter: chris fleizach <cfleizach>
Component: AccessibilityAssignee: chris fleizach <cfleizach>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch none

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