Steps to reproduce:
1. Visit https://codepen.io/edwinm/pen/BERXpG
2. Scroll horizontally with the keyboard
The viewport snaps between snap points without animating.
The viewport scroll position should animate between snap points
Created attachment 418031 [details]
Created attachment 418032 [details]
I would love some input on this change as I have a few doubts. On Mac, it doesn't seem like keyboard scrolling normally animates in overflow areas, but I found the experience of using the arrow keys to scroll pretty disorienting when snapping occurred. This change only animates when snapping will change the destination of a keyboard scroll. I'm not sure if that's the desired behavior.
The other question I have is about testing. I'm really unsure about how to test that animation is happening during snaps. I could write some code to have this run through ScrollAnimatorMock, but the substantive changes are in ScrollAnimatorMac. I'm not sure what the best approach is here.
Comment on attachment 418032 [details]
After chatting with Simon, I think the best thing to do here is to enable the scroll animator for RenderLayers.
Created attachment 421399 [details]
I have uploaded a new patch here that turns on the ScrollAnimator for RenderLayers. In practice this means that scrolling with the keyboard in scrolling overflow will animate, when it didn't before. This also includes animations for scroll snapping.
Created attachment 423495 [details]
The new version of this change includes tests. I had to expose a new Internals API in order to override the system scroll animations setting. By default animations are disabled for scrolling on Mac using NSUserDefaults.
Created attachment 423593 [details]
Created attachment 424237 [details]
Created attachment 424332 [details]
There's another minor bug in STP 124 that can be observed in the referenced codepen here: hit <space> to scroll down/<shift>+<space> to scroll up. Typically, Safari animates vertical scroll, but it doesn't for scroll snap containers.
This behavior was demonstrated as part of https://bugs.webkit.org/show_bug.cgi?id=223406. This also seems relevant: https://bugs.webkit.org/show_bug.cgi?id=223375
*** This bug has been marked as a duplicate of bug 233591 ***