[webkit-reviews] review requested: [Bug 223021] CSS scroll snap should allow scrolling to the middle of snap areas that overflow the snapport : [Attachment 423466] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 17 03:15:18 PDT 2021


Martin Robinson <mrobinson at webkit.org> has asked  for review:
Bug 223021: CSS scroll snap should allow scrolling to the middle of snap areas
that overflow the snapport
https://bugs.webkit.org/show_bug.cgi?id=223021

Attachment 423466: Patch

https://bugs.webkit.org/attachment.cgi?id=423466&action=review




--- Comment #2 from Martin Robinson <mrobinson at webkit.org> ---
Created attachment 423466

  --> https://bugs.webkit.org/attachment.cgi?id=423466&action=review

Patch

Here's some background on these changes as they are a bit larger and more
complicated than normal:

Before this change when snap points were calculated after a layout and a
ScrollSnapOffsetsInfo was created with both the offsets of the snap points and
a set of ranges of offsets where no snapping occurred. These ranges were useful
because it made it simple to determine if a particular offset was subject to
snapping. With the implementation of this part of the specification, the
range-based approach is not as suitable because snap areas (which may overlap)
now affect whether or not a scroll will snap to a snap point.

Instead, this change take a lazier approach. During scrolling, we walk through
each potential snap offset and look at the associated snap area. This
information to determine if the destination scroll offset falls onto a snap
area that overflows the snapport or if it is subject to proximity snapping.


More information about the webkit-reviews mailing list