[csswg-drafts] [css-scroll-snap] Consider more specific guidance for scroll-into-view

fantasai has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-scroll-snap] Consider more specific guidance for scroll-into-view ==
>From a discussion about `scrollOptions` in https://github.com/whatwg/html/pull/2787#issuecomment-318849888 ...

> As for the preferred position of the focused element, the [CSS Scroll Snap module](https://www.w3.org/TR/css-scroll-snap/) already defines various parameters for the preferred scroll positions for viewing an element, and imho it is better to re-use these rather than establish a contradictory and less powerful set of arguments in the .focus() API. The `scroll-padding` property already specifies that it applies, and probably `scroll-snap-margin` should as well. The spec currently avoids specifying that focusing operations inherently trigger snapping to the element’s snap position, but it does specify that (even when snapping is off), a #fragmentID-targetted element should snap into position... so if this is desired behavior we can look into defining that behavior as well. In any case, it doesn't seem like this belongs specifically in the JS API, unless for some reason the behavior of an API call needs to differ from that of a user-triggered event.

Possible guidance to consider:
  * Suggesting that scroll-into-view operations consider scroll-snap-margin in addition to scroll-padding
  * Recommending that UAs use the element's snap position if it has one and snapping is on.
  * Allowing UAs to use the suggested snap position, if the element has defined one, even if snapping is off.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1707 using your GitHub account

Received on Wednesday, 9 August 2017 16:34:20 UTC