- From: Mozes via GitHub <noreply@w3.org>
- Date: Tue, 07 Apr 2026 21:46:49 +0000
- To: public-css-archive@w3.org
One edge case worth considering: when scrolling a collapsed range (i.e. a caret position) into view, a single boundary-point can correspond to two different visual positions.
For example, given `<p style="word-break: break-all">loremipsum</p>` that wraps after lorem, the boundary-point `{node: #text, offset: 5}` can be rendered either at the end of the first line (after lorem) or at the start of the second line (before ipsum). These are on different lines and at different scroll offsets, so "scroll this boundary-point into view" is ambiguous.
<img width="162" height="138" alt="Image" src="https://github.com/user-attachments/assets/fad09171-e2de-48ce-9228-a397a698cb0f" />
It would be ideal if the options bag accepted a parameter to disambiguate which of the two visual positions to scroll to, similar in spirit to the `setCaretInlineOffset` API I proposed in [w3c/selection-api#347](https://github.com/w3c/selection-api/issues/347), where the caller passes an inline offset and the closer of the two candidate positions wins.
--
GitHub Notification of comment by mozesstumpf
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6465#issuecomment-4202396072 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 7 April 2026 21:46:50 UTC