haikuwebkit/LayoutTests/intersection-observer
Ryosuke Niwa 364dab0f99 Source/WebCore:
REGRESSION(r279800): IntersectionObserver may never get a delivery of an observation if the element
has been unobserved and is disconnected
https://bugs.webkit.org/show_bug.cgi?id=228679

Reviewed by Chris Dumez.

The bug was caused by the elements of the pending entries not being considered as opaque roots
of the intersection observer. If the intersection observer is no longer observing those elements,
the JS wrapper of the intersection observer may be collected erroneously.

This patch addresses this issue by explicitly treating the elements of pending entries as
opaque roots of the intersection observer in IntersectionObserver::isReachableFromOpaqueRoots.

Test: intersection-observer/intersection-observer-keeps-element-of-queued-entry-alive.html

* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::isReachableFromOpaqueRoots const):

LayoutTests:
REGRESSION(r279800): IntersectionObserver may never get a delivery of an observation if the element has been unobserved and is disconnected
https://bugs.webkit.org/show_bug.cgi?id=228679

Reviewed by Chris Dumez.

Added a regression test.

* intersection-observer/intersection-observer-keeps-element-of-queued-entry-alive-expected.txt: Added.
* intersection-observer/intersection-observer-keeps-element-of-queued-entry-alive.html: Added.


Canonical link: https://commits.webkit.org/240176@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-02 19:14:48 +00:00
..
resources
initial-observation-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
initial-observation.html
intersection-clipped-to-target-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
intersection-clipped-to-target.html IntersectionObserverEntry#intersectionRatio can be larger than 1 2019-09-13 18:46:56 +00:00
intersection-observer-callback-after-gc-expected.txt
intersection-observer-callback-after-gc.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
intersection-observer-callback-leak-expected.txt
intersection-observer-callback-leak.html
intersection-observer-callback-timestamp-expected.txt
intersection-observer-callback-timestamp.html Timestamps should be the same for all rendering update steps 2020-04-28 00:22:49 +00:00
intersection-observer-entry-interface-expected.txt
intersection-observer-entry-interface.html
intersection-observer-entry-keeps-js-wrapper-of-target-alive-expected.txt IntersectionObserver doesn't keep target's JS wrapper alive 2018-11-06 20:52:51 +00:00
intersection-observer-entry-keeps-js-wrapper-of-target-alive.html
intersection-observer-entry-keeps-js-wrappers-of-rects-alive-expected.txt IntersectionObserverEntry doesn't keep JS wrappers of rects alive 2018-11-07 18:30:30 +00:00
intersection-observer-entry-keeps-js-wrappers-of-rects-alive.html
intersection-observer-interface-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
intersection-observer-interface.html
intersection-observer-keeps-element-of-queued-entry-alive-expected.txt
intersection-observer-keeps-element-of-queued-entry-alive.html
intersection-observer-keeps-js-wrapper-of-target-alive-expected.txt
intersection-observer-keeps-js-wrapper-of-target-alive.html
intersection-observer-should-not-leak-observed-nodes-expected.txt
intersection-observer-should-not-leak-observed-nodes.html
no-document-leak-expected.txt
no-document-leak.html
observer-and-callback-without-js-references-expected.txt
observer-and-callback-without-js-references.html
root-element-deleted-expected.txt ResizeObserver / IntersectionObserver memory leak on detached & out of reference elements 2021-07-10 01:03:03 +00:00
root-element-deleted.html
root-element-moved-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
root-element-moved.html
root-margin-with-zoom-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
root-margin-with-zoom.html
target-deleted-expected.txt
target-deleted.html