It will be helpful for moving selection code out of legacy inline boxes.
Created attachment 430684 [details] patch
Created attachment 430689 [details] patch
Created attachment 430690 [details] patch
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.).
> (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] patch
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].
<rdar://problem/78935528>