RESOLVED FIXED239848
Code cleanup in preparation for refactoring of computing relationships between AXObjects.
https://bugs.webkit.org/show_bug.cgi?id=239848
Summary Code cleanup in preparation for refactoring of computing relationships betwee...
Andres Gonzalez
Reported 2022-04-28 05:58:27 PDT
Code cleanup in preparation for refactoring of computing relationships between AXObjects.
Attachments
Patch (27.39 KB, patch)
2022-04-28 06:13 PDT, Andres Gonzalez
no flags
Patch (47.98 KB, patch)
2022-04-29 13:18 PDT, Andres Gonzalez
ews-feeder: commit-queue-
Patch (49.75 KB, patch)
2022-04-29 13:59 PDT, Andres Gonzalez
no flags
Patch (57.03 KB, patch)
2022-04-29 16:46 PDT, Andres Gonzalez
no flags
Patch (57.73 KB, patch)
2022-04-30 13:37 PDT, Andres Gonzalez
no flags
Radar WebKit Bug Importer
Comment 1 2022-04-28 05:58:35 PDT
Andres Gonzalez
Comment 2 2022-04-28 06:13:03 PDT
Tyler Wilcock
Comment 3 2022-04-28 12:47:17 PDT
Comment on attachment 458523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458523&action=review Seems like a really nice improvement! > Source/WebCore/accessibility/AccessibilityObject.cpp:4018 > + if (!labelFor.size()) Could this be labelFor.isEmpty()?
chris fleizach
Comment 4 2022-04-28 13:23:02 PDT
Comment on attachment 458523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458523&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:3953 > +AXCoreObject::AccessibilityChildrenVector AccessibilityObject::activeDescendantOf() const this feels like it should be plural activeDescendantsOf > Source/WebCore/accessibility/AccessibilityObject.h:307 > + AccessibilityChildrenVector descriptionFor() const override; I don't feel like these methods indicate they're returning elements. descriptionFor() sounds like it could be a string returning function can we call it something like "descriptionElementsFor()" or "errorMessageElementsFor()"
Andres Gonzalez
Comment 5 2022-04-29 13:18:22 PDT
Andres Gonzalez
Comment 6 2022-04-29 13:20:32 PDT
(In reply to Tyler Wilcock from comment #3) > Comment on attachment 458523 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=458523&action=review > > Seems like a really nice improvement! > > > Source/WebCore/accessibility/AccessibilityObject.cpp:4018 > > + if (!labelFor.size()) > > Could this be labelFor.isEmpty()? Yes, using isEmpty() in more places where it makes the code more legible.
Andres Gonzalez
Comment 7 2022-04-29 13:27:18 PDT
(In reply to chris fleizach from comment #4) > Comment on attachment 458523 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=458523&action=review > > > Source/WebCore/accessibility/AccessibilityObject.cpp:3953 > > +AXCoreObject::AccessibilityChildrenVector AccessibilityObject::activeDescendantOf() const > > this feels like it should be plural > activeDescendantsOf Renamed to activeDescendantOfObjects. ActiveDescendant is singular because it refers to this object, and the method returns the objects that "contain" this as their active descendant. Hopefully the naming now is a bit more clear. Let me know. > > > Source/WebCore/accessibility/AccessibilityObject.h:307 > > + AccessibilityChildrenVector descriptionFor() const override; > > I don't feel like these methods indicate they're returning elements. > descriptionFor() sounds like it could be a string returning function > > can we call it something like "descriptionElementsFor()" or > "errorMessageElementsFor()" Chose Objects as part of the name to avoid confusion with DOM Elements. Notice the symmetric methods for a given relationship. For instance, we have labelledByObjects and labelForObjects. Hopefully this is a bit more clear now. Let me know. Thanks.
Andres Gonzalez
Comment 8 2022-04-29 13:59:44 PDT
Created attachment 458607 [details] Patch Fix for iOS build.
Tyler Wilcock
Comment 9 2022-04-29 14:31:30 PDT
Comment on attachment 458607 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458607&action=review > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1084 > + linkedUIElements = flowToObjects(); Will this overwrite existing elements in `linkedUIElements`? If so, should we concat these vectors instead? > Source/WebCore/accessibility/AccessibilityTableRow.cpp:154 > + if (ownedObjects.size()) { Would this be better as !ownedObjects.isEmpty()?
Andres Gonzalez
Comment 10 2022-04-29 16:46:23 PDT
Andres Gonzalez
Comment 11 2022-04-29 16:52:40 PDT
(In reply to Tyler Wilcock from comment #9) > Comment on attachment 458607 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=458607&action=review > > > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1084 > > + linkedUIElements = flowToObjects(); > > Will this overwrite existing elements in `linkedUIElements`? If so, should > we concat these vectors instead? It is never used to concat linked objects. So while at it, also removed the out parameter and renamed to linkedObjects() like all the other relations methods. > > > Source/WebCore/accessibility/AccessibilityTableRow.cpp:154 > > + if (ownedObjects.size()) { > > Would this be better as !ownedObjects.isEmpty()? In this case I think either one is fine, but I opted for the shortest with no negation.
Andres Gonzalez
Comment 12 2022-04-30 13:37:11 PDT
EWS
Comment 13 2022-04-30 19:44:09 PDT
Committed r293650 (250154@main): <https://commits.webkit.org/250154@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458639 [details].
Note You need to log in before you can comment on or make changes to this bug.