Bug 248315

Summary: IntersectionObserver with svg root element does not react to viewbox/size changes
Product: WebKit Reporter: pom
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: graouts, rbuis, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
Attachments:
Description Flags
Test for InteractionObserver with an svg root element none

Description pom 2022-11-24 10:18:58 PST
Created attachment 463713 [details]
Test for InteractionObserver with an svg root element

When creating an InteractionObserver with an <svg> element as the root element and observing children (e.g. a <rect> element), the observer callback is not called when the viewbox/size of the <svg> element changes to reveal or hide some of its contents.

A simple test is attached with an svg element that contains a rect. Initially the rect is black (default fill) and outside of the viewbox. An InteractionObserver is created with the svg element as its root and the rect is observed. The callback changes the fill of the rect to green if it is intersecting and red if not (so it should always appear green if it appears at all, and never red). The viewbox and size of the SVG element are modified after 1 second to contain the rect, which should then appear green.

In Safari 15.5 and STP 158 (as well as Chrome 107), the rect appears red; in Firefox 107, the rect appears green, which is the expected behaviour.
Comment 1 Radar WebKit Bug Importer 2022-11-24 10:44:37 PST
<rdar://problem/102650728>