WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
226697
Factor selection clamping into a type
https://bugs.webkit.org/show_bug.cgi?id=226697
Summary
Factor selection clamping into a type
Antti Koivisto
Reported
2021-06-06 08:12:38 PDT
It will be helpful for moving selection code out of legacy inline boxes.
Attachments
patch
(22.07 KB, patch)
2021-06-06 09:19 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(25.69 KB, patch)
2021-06-06 11:27 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(26.37 KB, patch)
2021-06-06 11:35 PDT
,
Antti Koivisto
sam
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
patch
(26.36 KB, patch)
2021-06-06 21:34 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2021-06-06 09:19:50 PDT
Created
attachment 430684
[details]
patch
Antti Koivisto
Comment 2
2021-06-06 11:27:52 PDT
Created
attachment 430689
[details]
patch
Antti Koivisto
Comment 3
2021-06-06 11:35:50 PDT
Created
attachment 430690
[details]
patch
Sam Weinig
Comment 4
2021-06-06 12:32:41 PDT
Comment on
attachment 430690
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430690&action=review
> Source/WebCore/rendering/TextBoxSelectableRange.h:39 > + auto clampedOffset = std::max(std::min(offset, start + length), start) - start;
I think you can write this as: auto clampedOffset = std::clamp(offset, start, start + length) - start; (though `- start` is kind of confusing, I do realize this is existing code you ar moving.).
Antti Koivisto
Comment 5
2021-06-06 13:26:41 PDT
> (though `- start` is kind of confusing, I do realize this is existing code > you ar moving.).
Yeah, in addition to clamping it also moves the offset to be relative to the current run start. I didn't know how to express that so didn't change the naming.
Antti Koivisto
Comment 6
2021-06-06 21:34:42 PDT
Created
attachment 430710
[details]
patch
EWS
Comment 7
2021-06-06 23:19:11 PDT
Committed
r278545
(
238543@main
): <
https://commits.webkit.org/238543@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 430710
[details]
.
Radar WebKit Bug Importer
Comment 8
2021-06-06 23:20:17 PDT
<
rdar://problem/78935528
>
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