| Summary: | IntersectionObserver with root:document computes subframe intersection incorrectly | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Dima Voytenko <dvoytenko> |
| Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | ajuma, simon.fraser, smoley, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Dima Voytenko
2020-11-16 16:46:50 PST
Thanks for filing. This reproduces for me on STP 115 and TOT. WebKit's behavior in this case seems to match the spec as currently written. According to https://www.w3.org/TR/intersection-observer/#intersection-observer-interface: "Any target of an explicit root observer ... must be in the same document as the intersection root." And according to https://www.w3.org/TR/intersection-observer/#update-intersection-observations-algo: "If the intersection root is not the implicit root, and target is not in the same document as the intersection root, skip to step 11." Skipping to step 11 means skipping the computation of the intersection. So in Document.cpp, computeIntersectionState() earlies-out if the observer has an explicit root but the target is in a different document. If other browsers are handling this case differently, perhaps the parts of the spec mentioned above need to be updated for the case where the explicit root is the main-frame's document. Thanks, Ali! I'll close this for now, until we figure out more about other browsers. |