Bug 241493 - Flashing when observed element is reparented in IntersectionObserver callback (without scroll anchoring)
Summary: Flashing when observed element is reparented in IntersectionObserver callback...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2022-06-09 16:06 PDT by Mike Taylor
Modified: 2022-06-22 10:06 PDT (History)
4 users (show)

See Also:

Testcase (1.69 KB, text/html)
2022-06-17 20:23 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Taylor 2022-06-09 16:06:42 PDT
(sorry, bad title)

This was originally filed against the IntersectionObserver spec: https://github.com/w3c/IntersectionObserver/issues/472

1. go to https://jsfiddle.net/90sw7dhf/
2. scroll down

Expected: in Firefox and Chrome, alternating green and blue divs, infinitely

Actual: in Safari TP, green turns blue, then a different shade of blue and that's it.

The jsfiddle has a log, and it seems like it's looping forever when trying to log "wow".
Comment 1 Radar WebKit Bug Importer 2022-06-13 10:48:43 PDT
Comment 2 Simon Fraser (smfr) 2022-06-17 20:23:32 PDT
Created attachment 460325 [details]
Comment 3 Simon Fraser (smfr) 2022-06-17 20:26:17 PDT
In both Chrome and Firefox there's a scroll position jump that happens when the elements are moved around. That might be a side effect of scroll anchoring, which Safari doesn't have.

Something similar happens in Firefox if I disable scroll anchoring, and that makes sense; moving the elements changes their intersection, which fires the callbacks, which changes the content.