Re: [csswg-drafts] [css-scroll-snap-1] Avoid page scrolling skipping past snappable items (#10914)

The most generic ergonomic approach would seem to be to add a granularity to [ScrollToOptions](https://www.w3.org/TR/cssom-view-1/#dictdef-scrolltooptions). If you passed a page granularity then it could interpret the `left` and `top` values as # of pages. Happy to bikeshed on names here and/or other options (e.g. it's common to scroll by lines).

However, given the algorithm for finding a snap area https://github.com/w3c/csswg-drafts/issues/10914#issuecomment-3497842094, if we naively use the given value, you may get different results if you `scrollBy({top: 1, granularity: 'page'}); scrollBy({top: 1, granularity: 'page'});` than if you `scrollBy({top: 2, granularity: 'page'});` as the first scroll in the first example may have chosen a snap area that is less than or more than the optimal page scroll distance resulting in a different range for the second scroll. I don't think this is necessarily a problem, just wanted to call it out.

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10914#issuecomment-3497871649 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 6 November 2025 15:36:59 UTC