blob: 27dffb04168f6371e29fd1d219bb56484daf0b9b [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/js-test.js"></script>
<script src="../resources/gc.js"></script>
<script src="../resources/intersection-observer-helper-functions.js"></script>
<div style="width:100%; height:700px;"></div>
<div id="target" style="background-color: green; width:100px; height:100px"></div>
<div style="width:100%; height:700px;"></div>
<script>
description("IntersectionObserver continues to produce notifications when it has no javascript references.");
var target = document.getElementById("target");
var entries = [];
new IntersectionObserver(function(changes) {
entries.push(...changes);
}).observe(target);
gc();
document.scrollingElement.scrollTop = 300;
waitForNotification(() => {
shouldBeEqualToNumber("entries.length", 1);
finishJSTest();
});
</script>