Bug 208563

Summary: Implement WKTextSelectionRect in terms of WebCore::SelectionRect and WKTextRange in terms of WKTextSelectionRect
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 13   
Bug Depends on: 208561    
Bug Blocks:    
Attachments:
Description Flags
For the bots
none
For the bots
none
For the bots
none
Patch
none
For the bots
none
Patch
none
Patch
none
For the bots none

Description Daniel Bates 2020-03-03 23:57:12 PST
Implement WKTextSelectionRect in terms of WebCore::SelectionRect and WKTextRange in terms of WKTextSelectionRect.
Comment 1 Daniel Bates 2020-03-03 23:59:11 PST
Created attachment 392380 [details]
For the bots
Comment 2 Daniel Bates 2020-03-04 00:00:23 PST
Created attachment 392381 [details]
For the bots
Comment 3 Daniel Bates 2020-03-04 00:14:51 PST
Created attachment 392382 [details]
For the bots
Comment 4 Daniel Bates 2020-03-04 00:17:37 PST
Created attachment 392383 [details]
Patch

This patch will fail to apply without the patch for bug #208561.
Comment 5 Daniel Bates 2020-03-04 00:30:58 PST
Created attachment 392386 [details]
For the bots
Comment 6 Daniel Bates 2020-03-04 01:04:34 PST
Created attachment 392390 [details]
Patch
Comment 7 Daniel Bates 2020-03-04 01:05:54 PST
Created attachment 392391 [details]
Patch
Comment 8 Daniel Bates 2020-03-04 01:06:59 PST
Created attachment 392392 [details]
For the bots
Comment 9 Alex Christensen 2020-03-04 08:50:22 PST
Comment on attachment 392391 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392391&action=review

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4465
> +    auto rects = adoptNS([[NSMutableArray alloc] initWithCapacity:coreRects.size()]);

arrayWithCapacity?
Comment 10 Daniel Bates 2020-03-04 09:59:51 PST
(In reply to Alex Christensen from comment #9)
> Comment on attachment 392391 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=392391&action=review
> 
> > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4465
> > +    auto rects = adoptNS([[NSMutableArray alloc] initWithCapacity:coreRects.size()]);
> 
> arrayWithCapacity?

I thought about it when I wrote this code and was debating whether to RetainPtr it all up or not. At the end fo the day I chose to go with RetainPtr (even though the code is not long!). The generated code will be just as efficient because of the inlining of autorelease()
Comment 11 Daniel Bates 2020-03-04 10:04:20 PST
Thanks for the review.
Comment 12 Daniel Bates 2020-03-04 10:05:47 PST
Comment on attachment 392391 [details]
Patch

Clearing flags on attachment: 392391

Committed r257852: <https://trac.webkit.org/changeset/257852>
Comment 13 Daniel Bates 2020-03-04 10:05:48 PST
All reviewed patches have been landed.  Closing bug.
Comment 14 Radar WebKit Bug Importer 2020-03-04 10:06:16 PST
<rdar://problem/60044375>