Bug 248315 - IntersectionObserver with svg root element does not react to viewbox/size changes
Summary: IntersectionObserver with svg root element does not react to viewbox/size cha...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-24 10:18 PST by pom
Modified: 2022-11-24 10:44 PST (History)
4 users (show)

See Also:


Attachments
Test for InteractionObserver with an svg root element (822 bytes, text/html)
2022-11-24 10:18 PST, pom
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>