Bug 215070

Summary: Remove some member functions of Range and many calls to createLiveRange
Product: WebKit Reporter: Darin Adler <darin>
Component: WebCore Misc.Assignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cdumez, cfleizach, changseok, dmazzoni, eric.carlson, esprehn+autocc, ews-watchlist, glenn, jcraig, jdiggs, jer.noble, kangil.han, kondapallykalyan, mifenton, pdr, philipj, samuel_white, sam, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Darin Adler
Reported 2020-08-01 19:14:45 PDT
Remove some member functions of Range and many calls to createLiveRange
Attachments
Patch (123.13 KB, patch)
2020-08-01 20:14 PDT, Darin Adler
no flags
Patch (124.34 KB, patch)
2020-08-01 21:05 PDT, Darin Adler
no flags
Patch (124.98 KB, patch)
2020-08-01 23:20 PDT, Darin Adler
no flags
Darin Adler
Comment 1 2020-08-01 20:14:55 PDT Comment hidden (obsolete)
Darin Adler
Comment 2 2020-08-01 21:05:10 PDT Comment hidden (obsolete)
Darin Adler
Comment 3 2020-08-01 23:20:54 PDT
Darin Adler
Comment 4 2020-08-02 13:31:31 PDT
Passing all tests now; given recent history I’m guessing review will be Sam?
Sam Weinig
Comment 5 2020-08-02 17:37:10 PDT
Comment on attachment 405809 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405809&action=review > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:2342 > +// FIXME: No reason for this to be a method instead of a function. > +- (NSRange)_convertToNSRange:(const SimpleRange&)range Reminds me we should investigate using direct methods / members at some point (https://reviews.llvm.org/D69991 / https://nshipster.com/direct/). > Source/WebCore/page/TextIndicator.cpp:306 > + textRects = RenderObject::collectSelectionRects(range).map([&](const auto& rect) -> FloatRect { Is the explicit return type needed here? > Source/WebCore/rendering/RenderObject.h:551 > + WEBCORE_EXPORT static Vector<SelectionRect> collectSelectionRects(const SimpleRange&); > + WEBCORE_EXPORT static Vector<SelectionRect> collectSelectionRectsWithoutUnionInteriorLines(const SimpleRange&); I'm a little sad to be adding more to RenderObject, but given that there is already collectSelectionRects functions here, it seems ok. Do they use the fact that they are static member functions in anyway?
EWS
Comment 6 2020-08-02 17:47:57 PDT
Committed r265190: <https://trac.webkit.org/changeset/265190> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405809 [details].
Radar WebKit Bug Importer
Comment 7 2020-08-02 17:48:17 PDT
Darin Adler
Comment 8 2020-08-03 09:29:46 PDT
Comment on attachment 405809 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405809&action=review >> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:2342 >> +- (NSRange)_convertToNSRange:(const SimpleRange&)range > > Reminds me we should investigate using direct methods / members at some point (https://reviews.llvm.org/D69991 / https://nshipster.com/direct/). Sure, that would apply to even more methods, including ones that, unlike this one, do use self! >> Source/WebCore/page/TextIndicator.cpp:306 >> + textRects = RenderObject::collectSelectionRects(range).map([&](const auto& rect) -> FloatRect { > > Is the explicit return type needed here? Yes, because otherwise it’s an IntRect. >> Source/WebCore/rendering/RenderObject.h:551 >> + WEBCORE_EXPORT static Vector<SelectionRect> collectSelectionRectsWithoutUnionInteriorLines(const SimpleRange&); > > I'm a little sad to be adding more to RenderObject, but given that there is already collectSelectionRects functions here, it seems ok. Do they use the fact that they are static member functions in anyway? They do not. These functions can live anywhere appropriate. I am happy to move them out of RenderObject to a better home. When moving them out of Range I chose to put them next to the underlying RenderObject functions they are based on, but would be happy to put them somewhere else. Clearly they are part of "rendering". Really open to moving them again! It won’t be hard.
Note You need to log in before you can comment on or make changes to this bug.