Closed
Description
The implicit root refers to the top window's scrolling viewport, but there is currently no way to track the intersection of an element inside an iframe with the iframe window's scrolling viewport. We might try something like this (running in the iframe's context):
new IntersectionObserver(callback, {root: document.scrollingElement})
... but that doesn't work, because document.scrollingElement.getBoundingClientRect gives you the full size of the document's content, not the window's scrolling viewport.
I think document.scrollingElement ought to be treated specially when it's used as the root of an IntersectionObserver: it should be treated as measuring intersection with the document window's scrolling viewport.