scroll-snap plus a :hover transform jiggles the scroll offset forever

#40788643 Area: Blink>Scroll / scroll-snap CL 8656438 In Review

What happens

A snap area that moves under :hover -- a scaled card, a lifted tile -- changes the snap container's data, so the post-layout re-snap pulls the scroll offset to the area's new position. That moves the content out from under the pointer, :hover drops, the area moves back, and the next re-snap pulls the offset the other way. The offset oscillates between two values for as long as the pointer rests there: reported in 2021 as "terrible scroll jank and jiggle".

The CL still re-snaps to the same snap areas, it just leaves the scroll offset alone when the area moved because of :hover. css-scroll-snap explicitly leaves the scrolling behaviour of re-snapping to the same box up to the UA. Behind the default-on ScrollSnapNoHoverAdjustment kill switch.

Pointer resting on the snapped item, scrollTop sampled for 10 frames

Before: offsets alternate 100/125
Kill switch off: 100,125,100,125,... -- a new offset every frame, and the item is caught mid-flip at full size.
After: offsets constant
With the fix: 100,100,100,..., the hovered item simply stays scaled.
Diff mask over the whole scroller
16070 px differ -- the entire scroller contents, because the before build is mid-oscillation.
Live: hover an item. On unpatched Chrome the readout fills with alternating offsets.

What the re-review changed

Verification

Links

Issue 40788643 CL 8656438 standalone sampler.html capture_screenshots.py