Gecko:CSSScrollSnapping: Difference between revisions

Jump to navigation Jump to search
Line 22: Line 22:
These definitions implicitly require transforming a box rectangle up to the coordinate space of the element E. When CSS transforms are present, preserve axis-alignment by using the smallest axis-aligned rectangle that contains the transformed box.
These definitions implicitly require transforming a box rectangle up to the coordinate space of the element E. When CSS transforms are present, preserve axis-alignment by using the smallest axis-aligned rectangle that contains the transformed box.


The algorithm for computing which snapping opportunity (if any) to take is gesture and UA dependent. However the following constraints should be honored:
The algorithm for computing which snapping opportunity (if any) to take is gesture and UA dependent. However the following constraints must be honored:
* When scrolling along an axis for which 'scroll-snap-type' is 'mandatory', the UA should settle on a scroll position which matches one of the snapping opportunities for that axis. However this requirement is lifted if one or more of the snapping opportunities' boxes B is larger than the scroll-port.
* When scrolling along an axis for which 'scroll-snap-type' is 'mandatory', the UA should settle on a scroll position which matches one of the snapping opportunities for that axis. However this requirement is lifted if one or more of the snapping opportunities' boxes B is larger than the scroll-port.
* When 'scroll-snap-type' is 'none' for some axis, no scroll snapping occurs along that axis.
* When 'scroll-snap-type' is 'none' for some axis, no scroll snapping occurs along that axis.


UAs should apply scroll snapping to all user scroll gestures (including keyboard, scrollbars, etc). Script-driven scrolling (e.g. setting <tt>scrollLeft</tt> or <tt>scrollTop</tt>) is never affected by scroll snapping. Layout changes that affect the positions of elements with 'scroll-snap-edges', or dynamic changes to values of 'scroll-snap-edges', do not trigger snapping in the absence of a scroll gesture, even if 'mandatory' snapping is requested.
UAs should apply scroll snapping to all user scroll gestures (including keyboard, scrollbars, etc). Script-driven scrolling (e.g. setting <tt>scrollLeft</tt> or <tt>scrollTop</tt>) is never affected by scroll snapping. Layout changes that affect the positions of elements with 'scroll-snap-edges', or dynamic changes to values of 'scroll-snap-edges', do not trigger snapping in the absence of a scroll gesture, even if 'mandatory' snapping is requested.
1,295

edits

Navigation menu