w3c/IntersectionObserver

Intersection checks in IntersectionObserver should use ink overflow rect as the intersection rect

Opened this issue · 2 comments

Forking from w3c/csswg-drafts#7758 (comment). The algorithm here uses the result of getBoundingClientRect() as the element's box to intersect against. It should be the element's ink overflow rect instead so expansion from properties like box-shadow, filter is included in calculating the element's visibility.

@szager-chromium

I don't think it's feasible to change the default behavior of IntersectonObserver at this time. IntersectionObserver v1 is designed to consider layout geometries mostly (perhaps except for clip-path?). Perhaps this will be a good topic for IntersectionObserver v2, or we should probably add a flag in IntersectionObserver API.

Adding it as an opt-in would also be good. Other features (anchor-positioning/view-transitions) which are WIP can then default to this mode without compat risk.

@tabatkins fyi.