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: | Accessibility | Assignee: | 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
Tyler Wilcock
2024-04-06 09:54:01 PDT
Created attachment 470787 [details]
Patch
Created attachment 470788 [details]
Patch
Created attachment 470789 [details]
Patch
Created attachment 470790 [details]
Patch
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? Created attachment 470919 [details]
Patch
> > 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!
Created attachment 470966 [details]
Patch
Created attachment 470982 [details]
Patch
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]. |