Open szager-chromium opened 3 years ago
For what it's worth, it turns out this can also cause intersectionRatio >= 0 to be fired even before an item comes onscreen
@szager-chromium This happen when display settings is big than 100%, so in my case i have 1.25 for window.devicePixelRatio
windows 10 display settings
First reported as a chromium bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=1020466#c14
This is unexpected and useless behavior.
Off the top of my head: we could compute intersectionRatio based on pixel-snapped geometry. It would still be possible to derive intersectionRatio based on boundingClientRect and intersectionRect; but it would no longer be just a simple ratio of areas. It would also mean that in some cases (intersectionRatio == 1 && boundingClientRect != intersectionRect), which is also unintuitive.