WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
209462
Simplify characterRectsForRange() in WebPage::requestDocumentEditingContext()
https://bugs.webkit.org/show_bug.cgi?id=209462
Summary
Simplify characterRectsForRange() in WebPage::requestDocumentEditingContext()
Daniel Bates
Reported
2020-03-23 21:06:57 PDT
Simplify characterRectsForRange() before I make changes to it.
Attachments
Patch
(2.97 KB, patch)
2020-03-23 21:13 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Patch
(2.97 KB, patch)
2020-03-23 21:53 PDT
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2020-03-23 21:13:37 PDT
Created
attachment 394350
[details]
Patch
Daniel Bates
Comment 2
2020-03-23 21:51:45 PDT
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++
Daniel Bates
Comment 3
2020-03-23 21:53:21 PDT
Created
attachment 394353
[details]
Patch
Wenson Hsieh
Comment 4
2020-03-23 21:54:38 PDT
Comment on
attachment 394353
[details]
Patch r=mews
Daniel Bates
Comment 5
2020-03-23 22:06:59 PDT
Thanks Wenson!
Daniel Bates
Comment 6
2020-03-24 11:00:19 PDT
Comment on
attachment 394353
[details]
Patch Clearing flags on attachment: 394353 Committed
r258920
: <
https://trac.webkit.org/changeset/258920
>
Daniel Bates
Comment 7
2020-03-24 11:00:20 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8
2020-03-24 11:01:16 PDT
<
rdar://problem/60832084
>
Darin Adler
Comment 9
2020-03-24 12:21:14 PDT
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.
Daniel Bates
Comment 10
2020-03-24 14:06:10 PDT
(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.
Daniel Bates
Comment 11
2020-03-24 14:07:55 PDT
(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.
Darin Adler
Comment 12
2020-03-24 14:08:31 PDT
(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.
Daniel Bates
Comment 13
2020-03-24 14:17:45 PDT
(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
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug