Bug 272279

Summary: AX: Use more reference types in accessibility code when values are known to be non-null
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cdumez, cfleizach, changseok, cmarcelo, dmazzoni, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jcraig, kangil.han, kondapallykalyan, mifenton, pdr, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Tyler Wilcock
Reported 2024-04-06 09:54:01 PDT
This reduces unnecessary null checks and allows us to remove ASSERT(value) and unchecked dereferences.
Attachments
Patch (71.43 KB, patch)
2024-04-06 09:57 PDT, Tyler Wilcock
ews-feeder: commit-queue-
Patch (71.83 KB, patch)
2024-04-06 10:15 PDT, Tyler Wilcock
ews-feeder: commit-queue-
Patch (74.24 KB, patch)
2024-04-06 10:20 PDT, Tyler Wilcock
no flags
Patch (74.28 KB, patch)
2024-04-06 10:29 PDT, Tyler Wilcock
no flags
Patch (74.55 KB, patch)
2024-04-14 07:25 PDT, Tyler Wilcock
no flags
Patch (74.55 KB, patch)
2024-04-17 11:44 PDT, Tyler Wilcock
no flags
Patch (74.55 KB, patch)
2024-04-17 21:43 PDT, Tyler Wilcock
no flags
Radar WebKit Bug Importer
Comment 1 2024-04-06 09:54:09 PDT
Tyler Wilcock
Comment 2 2024-04-06 09:57:38 PDT
Tyler Wilcock
Comment 3 2024-04-06 10:15:52 PDT
Tyler Wilcock
Comment 4 2024-04-06 10:20:14 PDT
Tyler Wilcock
Comment 5 2024-04-06 10:29:55 PDT
chris fleizach
Comment 6 2024-04-14 06:20:09 PDT
Comment on attachment 470790 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=470790&action=review > Source/WebCore/accessibility/AXObjectCache.cpp:154 > +static bool rendererIsValid(Node& node) Feels like name should be NodeRendererIsValid > Source/WebCore/accessibility/AXObjectCache.cpp:3136 > Node* domNode = &node; Do we still Need a ptr here or can we use a reference in the method > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1743 > for (RefPtr e = position.anchorElementAncestor(); e && e != rootEditableElement; e = e->parentElement()) { Do we have to use e for a variable name?
Tyler Wilcock
Comment 7 2024-04-14 07:25:36 PDT
Tyler Wilcock
Comment 8 2024-04-14 07:27:51 PDT
> > Source/WebCore/accessibility/AXObjectCache.cpp:3136 > > Node* domNode = &node; > > Do we still > Need a ptr here or can we use a reference in the method We do still need a pointer, as `domNode` gets re-assigned in the loop below, and references aren't allowed to be re-assigned. Fixed the other two comments, thanks!
Tyler Wilcock
Comment 9 2024-04-17 11:44:30 PDT
Tyler Wilcock
Comment 10 2024-04-17 21:43:12 PDT
EWS
Comment 11 2024-04-18 07:55:42 PDT
Committed 277672@main (9487ec0b9ebd): <https://commits.webkit.org/277672@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 470982 [details].
Note You need to log in before you can comment on or make changes to this bug.