Bug 226697

Summary: Factor selection clamping into a type
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, bfulgham, changseok, dino, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, kondapallykalyan, mmaxfield, pdr, ryuan.choi, sabouhallawa, sam, schenney, sergio, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch
none
patch
sam: review+, ews-feeder: commit-queue-
patch none

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
patch (25.69 KB, patch)
2021-06-06 11:27 PDT, Antti Koivisto
no flags
patch (26.37 KB, patch)
2021-06-06 11:35 PDT, Antti Koivisto
sam: review+
ews-feeder: commit-queue-
patch (26.36 KB, patch)
2021-06-06 21:34 PDT, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2021-06-06 09:19:50 PDT
Antti Koivisto
Comment 2 2021-06-06 11:27:52 PDT
Antti Koivisto
Comment 3 2021-06-06 11:35:50 PDT
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
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
Note You need to log in before you can comment on or make changes to this bug.