Bug 314946
| Summary: | IntersectionObserver is broken at zooms outside 100% | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Alex <alexander> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bfulgham, kiet.ho, simon.fraser, zalan |
| Priority: | P2 | ||
| Version: | Safari 26 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Alex
Steps to reproduce:
1. Have a container with children that are 100% in both height and width, i.e. match parents size EXACTLTY.
2. Add CSS scroll snap so that each child is not just the same size as parent, but also is match EXACTLY into frame regardless of scroll position.
3. Have IntersectionObserver at 1.0 threshold to monitor the current active slide.
4. Change zoom to something other than 100%.
Actual results:
IntersectionObserver stops triggering properly, you can see it in this super minimalistic carousel demo:
https://codepen.io/waterplea/pen/XJjzrQW
At, say 90% or 110% it stops working when swiping to the right, only to the left.
Expected results:
IntersectionObserver is triggered whenever a frame is snapped into place fully.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Simon Fraser (smfr)
Alex, what OS/Safari version are you testing on?
Alex
macOS 26.4.1
Safari Version 26.4 (21624.1.16.11.4)
This actually happens for all browsers and OSes, it seems, I have filed an issue for FF and for Chrome it is already there for a few years. Not sure about Safari, but in Chrome those 90%/110% zoom causes elements to have subpixel sizes which causes IntersectionObserver to stop firing.
Kiet Ho
Alex, thank you for the bug report. When you say zoom, is this zooming by Cmd+/- or pinch zoom?
Alex
By Cmd+/-, yes.