You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example on how to determine the active scroll marker in the css-overflow-5 spec directs user agents to run the determine-the-scroll-into-view-position algorithm but does not provide block and inline arguments which determine the alignment of the scroll container with its subject and default to "nearest".
I believe the intention for snap targets was to use the alignment indicated by scroll-snap-align but for non-snap targets, it seems we'd naturally be defaulting to "nearest". However, "nearest" might not be the best option as it means the target position, which is used to determine whether a target is within half a scroll port from the current scroll position, might have the target outside the viewport. I.e. the "nearest" scroll position that brings the element into view might be half a scroll port away from the current scroll position while the target's position itself is not. (See demo)
I propose we we have the algorithm supply "start" block and inline values as these would ensure that the target is within view when selected.
Activity
[scroll-marker] Use start as default alignment for non-snap markers