Bug 300729
| Summary: | IntersectionObserver should not notify targets in detached documents | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Stefan Zager <szager> |
| Component: | Layout and Rendering | Assignee: | Ahmad Saleem <ahmad.saleem792> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bfulgham, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Stefan Zager
This reverses prior guidance:
https://github.com/web-platform-tests/wpt/pull/23308
The spec dictates that IntersectionObserver notifications be generated during the "update the rendering" steps of the document event loop (step 19), but detached documents do not run these steps. Step 3 of "update the rendering" filters non-rendering documents out of the list of documents to update. Hence there is no provision in the spec for IntersectionObserver to run in a detached document.
https://html.spec.whatwg.org/#update-the-rendering
Test coverage for this issue is provided by wpt/intersection-observer/target-in-detached-document.html, which currently passes in safari:
https://wpt.fyi/results/intersection-observer/target-in-detached-document.html?label=master&label=experimental&aligned
I plan to land a change to that test which will invert the expectation (i.e. it will assert that IntersectionObserver does not notify a target in a detached document), which will presumably cause the test to start failing in safari.
https://chromium-review.googlesource.com/c/chromium/src/+/7038511
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/162699098>
Ahmad Saleem
Pull request: https://github.com/WebKit/WebKit/pull/65550
EWS
Committed 313834@main (b49b5a000685): <https://commits.webkit.org/313834@main>
Reviewed commits have been landed. Closing PR #65550 and removing active labels.