Bug 214882

Summary: Improve range idioms and other changes to prepare the way for more reduction in live range use
Product: WebKit Reporter: Darin Adler <darin>
Component: WebKit Misc.Assignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cdumez, cfleizach, changseok, dmazzoni, esprehn+autocc, ews-watchlist, gyuyoung.kim, jcraig, jdiggs, kangil.han, mifenton, samuel_white, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Darin Adler 2020-07-28 10:00:54 PDT
Improve range idioms and other changes to prepare the way for more reduction in live range use
Comment 1 Darin Adler 2020-07-28 15:58:36 PDT Comment hidden (obsolete)
Comment 2 Darin Adler 2020-07-28 16:48:07 PDT
Created attachment 405427 [details]
Patch
Comment 3 Sam Weinig 2020-07-28 19:17:04 PDT
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 4 Darin Adler 2020-07-29 09:27:38 PDT
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.
Comment 5 EWS 2020-07-29 09:36:46 PDT
Committed r265044: <https://trac.webkit.org/changeset/265044>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405427 [details].
Comment 6 Radar WebKit Bug Importer 2020-07-29 09:37:18 PDT
<rdar://problem/66277887>
Comment 7 Andres Gonzalez 2020-08-15 10:16:25 PDT
*** Bug 215521 has been marked as a duplicate of this bug. ***