Bug 228679

Summary: REGRESSION(r279800): IntersectionObserver may never get a delivery of an observation if the element has been unobserved and is disconnected
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ajuma, cathiechen, cdumez, ggaren, simon.fraser
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=228693
https://bugs.webkit.org/show_bug.cgi?id=229196
Bug Depends on: 227194    
Bug Blocks:    
Attachments:
Description Flags
Fixes the bug none

Description Ryosuke Niwa 2021-07-31 03:26:34 PDT
After r279800 IntersectionObserver's callback may never be delivered if the observed element
has been disconnected from the document, and the element has been explicitly unobserved by IntersectionObserver.
Comment 1 Ryosuke Niwa 2021-07-31 04:17:28 PDT
ResizeObserver has a similar code but ResizeObserver.unobserve active observation as well so it doesn't exhibit a bug per se. I don't think this is correct per spec though. Will investigate separately.
Comment 2 Ryosuke Niwa 2021-07-31 04:28:06 PDT
Created attachment 434696 [details]
Fixes the bug
Comment 3 Chris Dumez 2021-08-02 08:21:22 PDT
Comment on attachment 434696 [details]
Fixes the bug

r=me
Comment 4 Ryosuke Niwa 2021-08-02 12:14:39 PDT
<rdar://81057759>
Comment 5 Ryosuke Niwa 2021-08-02 12:14:52 PDT
Comment on attachment 434696 [details]
Fixes the bug

Clearing flags on attachment: 434696

Committed r280549 (240176@main): <https://commits.webkit.org/240176@main>
Comment 6 Ryosuke Niwa 2021-08-02 12:14:54 PDT
All reviewed patches have been landed.  Closing bug.