[css-scroll-snap] scroll-snap-padding vs scroll-padding · Issue #395 · w3c/csswg-drafts (original) (raw)

The section about scroll types distinguishes between 3 types of scrolling. The new prose looks better to me than the old one, but I am not satisfied that the issue I raised a while back is resolved, and I still see a distinction between explicit end positions and implicit end positions.

In the following cases, the user indicates an explicit end position:

In these following cases however, the user does not indicate an explicit end position, and instead, merely expresses the wish that the thing in question is brought to any position within an acceptable range. It is the UA, not the user, that decides, within this acceptable range, which specific end position we should go after.

Once the end position has been picked, I think I agree these two categories result in the same behavior. But the reason I believe it is useful to distinguish between them is that
there is something to be said in the spec about what the acceptable range is.

Specifically, I believe that this acceptable range should be the scroll snapport, not the scroll viewport. Now, to be fair, this picking of a position within the acceptable range isn't actually about snapping, and conceptually happens before the snapping logic kicks in.

Which leads me to believe that the scroll-snap-padding property should be renamed into scroll-padding, and in addition to doing what it is currently defined to do with regards to snapping, it should also define the acceptable range of end position from which the UA is free to pick when converting a user's implicit scroll request into an explicit end position to be the "scroll snapport", even if there is no snapping involved in any way, and even if scroll-snap-type is none.

Whether it is because the author wants to give some breathing room around the content, or to avoid having the content that has been scrolled / snapped into view to be obscured by a fix-pos overlay or similar, the use cases that justify having a non zero scroll-snap-padding when snapping are just as valid when no snapping is involved and we're dealing with implicit scrolls.

EDIT: fixed a few typos