Bug 260357

Summary: AX: Unify check for whether an Element can have AX relations.
Product: WebKit Reporter: Andres Gonzalez <andresg_22>
Component: AccessibilityAssignee: Andres Gonzalez <andresg_22>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, tyler_w, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Andres Gonzalez 2023-08-17 10:53:14 PDT
.
Comment 1 Radar WebKit Bug Importer 2023-08-17 10:53:28 PDT
<rdar://problem/114035912>
Comment 2 Andres Gonzalez 2023-08-17 11:23:34 PDT
Created attachment 467312 [details]
Patch
Comment 3 Tyler Wilcock 2023-08-17 11:53:25 PDT
Comment on attachment 467312 [details]
Patch

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

> Source/WebCore/accessibility/AXObjectCache.cpp:4387
> +    return !(element.hasTagName(metaTag) || element.hasTagName(headTag) || element.hasTagName(scriptTag) || element.hasTagName(htmlTag) || element.hasTagName(styleTag));

What do you think reads better, this, or "!element.hasTagName(metaTag) && !element.hasTagName(headTag) && !element.hasTagName()..."

I prefer the latter, but don't feel too strongly.
Comment 4 Andres Gonzalez 2023-08-17 12:03:16 PDT
(In reply to Tyler Wilcock from comment #3)
> Comment on attachment 467312 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=467312&action=review
> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:4387
> > +    return !(element.hasTagName(metaTag) || element.hasTagName(headTag) || element.hasTagName(scriptTag) || element.hasTagName(htmlTag) || element.hasTagName(styleTag));
> 
> What do you think reads better, this, or "!element.hasTagName(metaTag) &&
> !element.hasTagName(headTag) && !element.hasTagName()..."
> 
> I prefer the latter, but don't feel too strongly.

I prefer the former but don't feel strongly :-) It is shorter and less chances to miss a !
Comment 5 EWS 2023-08-17 19:21:31 PDT
Committed 267027@main (3677b9c10c62): <https://commits.webkit.org/267027@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 467312 [details].