| Summary: | Simplify characterRectsForRange() in WebPage::requestDocumentEditingContext() | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||||
| Component: | WebKit Misc. | Assignee: | Daniel Bates <dbates> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | darin, webkit-bug-importer, wenson_hsieh | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Local Build | ||||||||
| Hardware: | iPhone / iPad | ||||||||
| OS: | iOS 13 | ||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=209495 | ||||||||
| Attachments: |
|
||||||||
|
Description
Daniel Bates
2020-03-23 21:06:57 PDT
Created attachment 394350 [details]
Patch
Comment on attachment 394350 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394350&action=review > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:4246 > + rects.append({ createLiveRange(iterator.range())->absoluteBoundingBox(Range::BoundingRectBehavior::IgnoreEmptyTextSelections), { ++offsetSoFar, stride } }); r-, should be offsetSoFar++ Created attachment 394353 [details]
Patch
Comment on attachment 394353 [details]
Patch
r=mews
Thanks Wenson! Comment on attachment 394353 [details] Patch Clearing flags on attachment: 394353 Committed r258920: <https://trac.webkit.org/changeset/258920> All reviewed patches have been landed. Closing bug. Comment on attachment 394350 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394350&action=review > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:4239 > + auto characterRectsForRange = [](const Range& range, unsigned startOffset) { No reason for this to take const Range& instead of const SimpleRange&; all this function does with the range is create a CharacterIterator, which takes a SimpleRange. (In reply to Darin Adler from comment #9) > Comment on attachment 394350 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=394350&action=review > > > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:4239 > > + auto characterRectsForRange = [](const Range& range, unsigned startOffset) { > > No reason for this to take const Range& instead of const SimpleRange&; all > this function does with the range is create a CharacterIterator, which takes > a SimpleRange. That's too simple to do. (In reply to Daniel Bates from comment #10) > (In reply to Darin Adler from comment #9) > > Comment on attachment 394350 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=394350&action=review > > > > > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:4239 > > > + auto characterRectsForRange = [](const Range& range, unsigned startOffset) { > > > > No reason for this to take const Range& instead of const SimpleRange&; all > > this function does with the range is create a CharacterIterator, which takes > > a SimpleRange. > > That's too simple to do. I was joking by the way. I can change it, but the caller currently passes a Range. I haven't put thought into whether the caller can be a SimpleRange. (In reply to Daniel Bates from comment #11) > I was joking by the way. I can change it, but the caller currently passes a > Range. I haven't put thought into whether the caller can be a SimpleRange. You can pass a Range to a function that takes a const SimpleRange&. Caller won’t have to change at all. (In reply to Darin Adler from comment #12) > (In reply to Daniel Bates from comment #11) > > I was joking by the way. I can change it, but the caller currently passes a > > Range. I haven't put thought into whether the caller can be a SimpleRange. > > You can pass a Range to a function that takes a const SimpleRange&. Caller > won’t have to change at all. OK. Patch up at bug #209495. |