Improve range idioms and other changes to prepare the way for more reduction in live range use
Created attachment 405423 [details] Patch
Created attachment 405427 [details] Patch
Comment on attachment 405427 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405427&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:1181 > VisiblePositionRange AccessibilityObject::lineRangeForPosition(const VisiblePosition& visiblePosition) const > { > - VisiblePosition startPosition = startOfLine(visiblePosition); > - VisiblePosition endPosition = endOfLine(visiblePosition); > - return VisiblePositionRange(startPosition, endPosition); > + return { startOfLine(visiblePosition), endOfLine(visiblePosition) }; Some of these functions don't seem like they belong as member functions on AccessibilityObject, given how general they are, and that they don't seem to be using any state or functions of AccessibilityObject. In another change (not this one), it might be a good idea to move some of these to VisibileUnit.h or similar.
Comment on attachment 405427 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405427&action=review >> Source/WebCore/accessibility/AccessibilityObject.cpp:1181 >> + return { startOfLine(visiblePosition), endOfLine(visiblePosition) }; > > Some of these functions don't seem like they belong as member functions on AccessibilityObject, given how general they are, and that they don't seem to be using any state or functions of AccessibilityObject. In another change (not this one), it might be a good idea to move some of these to VisibileUnit.h or similar. Agreed. I’ll try to come back to that later. In some cases the functions look universal but have some sort of subtle dependency on the accessibility object, so it’s a non-trivial project to disentangle.
Committed r265044: <https://trac.webkit.org/changeset/265044> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405427 [details].
<rdar://problem/66277887>
*** Bug 215521 has been marked as a duplicate of this bug. ***