Re: [csswg-drafts] Element-based start and end offsets (#4337)

Another interesting edge case is when target element (or scroll source?) does not have a layout box. We should handle this case gracefully as well. 

Looking at [InteresectionObserver](https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo), it invokes [`getBoundingClientRect`](https://drafts.csswg.org/cssom-view-1/#dom-element-getboundingclientrect), which invokes [`getClientRects`](https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects) that returns an empty rect when there is no layout box.  

> If the element on which it was invoked does not have an associated layout box return an empty DOMRectList object and stop this algorithm.

For IntersectionObserve, this means an empty intersection which probably safe. For ScrollTimeline have to check if a similar solution works or perhaps we should be more explicitly handling this case as opposed to relying on empty rects.

-- 
GitHub Notification of comment by majido
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4337#issuecomment-610997231 using your GitHub account

Received on Wednesday, 8 April 2020 14:37:49 UTC