haikuwebkit/LayoutTests/resize-observer
Ryosuke Niwa 00c08681e9 Calling unobserve on ResizeObserver should not clear existing observations in active targets
https://bugs.webkit.org/show_bug.cgi?id=228693

Reviewed by Chris Dumez.

Source/WebCore:

The bug was caused by ResizeObserver::removeObservation removing it from the active targets.

Note that there is nothing in the specification which alludes to this behavior,
and the new behavior is consistent with Firefox and the way IntersectionObserver works:
https://drafts.csswg.org/resize-observer/#dom-resizeobserver-unobserve

To keep elements alive while they're in the active targets but not in the observation targets,
this patch also makes each element of the active observation as opaque roots of ResizeObserver
in ResizeObserver::isReachableFromOpaqueRoots.

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

* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::deliverObservations):
(WebCore::ResizeObserver::isReachableFromOpaqueRoots const):
(WebCore::ResizeObserver::removeObservation):

LayoutTests:

Added a regression test.

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


Canonical link: https://commits.webkit.org/240178@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-02 20:03:15 +00:00
..
resources
delete-observers-in-callbacks-expected.txt
delete-observers-in-callbacks.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
element-leak-expected.txt
element-leak.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
modify-frametree-in-callback-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
modify-frametree-in-callback.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
multi-frames-expected.txt
multi-frames.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
observe-element-from-other-frame-expected.txt
observe-element-from-other-frame.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
resize-observer-callback-leak-expected.txt
resize-observer-callback-leak.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
resize-observer-entry-keeps-js-wrapper-of-target-alive-expected.txt
resize-observer-entry-keeps-js-wrapper-of-target-alive.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
resize-observer-keeps-element-of-queued-entry-alive-expected.txt Calling unobserve on ResizeObserver should not clear existing observations in active targets 2021-08-02 20:03:15 +00:00
resize-observer-keeps-element-of-queued-entry-alive.html Calling unobserve on ResizeObserver should not clear existing observations in active targets 2021-08-02 20:03:15 +00:00
resize-observer-keeps-js-wrapper-of-target-alive-expected.txt
resize-observer-keeps-js-wrapper-of-target-alive.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
resize-observer-should-not-leak-observed-nodes-expected.txt ResizeObserver / IntersectionObserver memory leak on detached & out of reference elements 2021-07-10 01:03:03 +00:00
resize-observer-should-not-leak-observed-nodes.html ResizeObserver / IntersectionObserver memory leak on detached & out of reference elements 2021-07-10 01:03:03 +00:00
resize-observer-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
resize-observer-with-zoom.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00