It will be helpful for moving selection code out of legacy inline boxes.
Created attachment 430684 [details]
Created attachment 430689 [details]
Created attachment 430690 [details]
Comment on attachment 430690 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=430690&action=review
> + 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.).
> (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.
Created attachment 430710 [details]
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].