Bug 293227

Summary: Element.scrollBy() doesn't snap with scroll-snap-type mandatory
Product: WebKit Reporter: Martin (MConverter) <webkit.bugzilla>
Component: ScrollingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, karlcow, simon.fraser, webkit-bug-importer, webkit.bugzilla, woodlxf00
Priority: P2 Keywords: InRadar
Version: Safari 18   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=241737
Attachments:
Description Flags
Demo none

Martin (MConverter)
Reported 2025-05-19 04:50:03 PDT
Created attachment 475302 [details] Demo Expected behavior (works in Firefox, Chrome): On each 1.5 seconds, the container should scroll and snap to the next snapping point. Actual behavior in Safari (on macOS and iOS): On each 1.5 seconds, the container scrolls by 1px, and doesn't snap to any snapping point. Demo: https://safari-auto-scroll-snap.glitch.me/
Attachments
Demo (1.06 KB, text/html)
2025-05-19 04:50 PDT, Martin (MConverter)
no flags
Radar WebKit Bug Importer
Comment 1 2025-05-26 04:50:16 PDT
Ahmad Saleem
Comment 2 2025-06-18 04:04:30 PDT
Does it affect any live website or mconverter.eu?
Martin (MConverter)
Comment 3 2025-06-18 18:56:20 PDT
(In reply to Ahmad Saleem from comment #2) > Does it affect any live website or mconverter.eu? Yes, this bug affects the auto-scrolling quotes on MConverter's live pricing page: https://mconverter.eu/#upgrade
Woody Lee
Comment 4 2025-07-08 18:20:36 PDT
Please pay extra attention to the decimal size case: Programmatic scroll don't meet CSS scroll snap when the stop item size is with non-integer size. The issue reproduces in both Chrome and Firefox. See also: https://issues.chromium.org/issues/423245958 https://bugzilla.mozilla.org/show_bug.cgi?id=1973652
Note You need to log in before you can comment on or make changes to this bug.