Automatic update from web-platform-tests WebKit export of https://bugs.webkit.org/show_bug.cgi?id=315779 -- wpt-commits: a61ae98d79237f84e9968b1363aac61db31ccf87 wpt-pr: 60379
29 lines
516 B
HTML
29 lines
516 B
HTML
<!DOCTYPE html>
|
|
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
#target {
|
|
position: absolute;
|
|
height: 150px;
|
|
width: 150px;
|
|
background-color: green;
|
|
}
|
|
</style>
|
|
|
|
<div id="target"></div>
|
|
|
|
<script>
|
|
let observer = new IntersectionObserver((observations) => {
|
|
const lastObservation = observations[observations.length - 1];
|
|
window.top.postMessage({
|
|
isIntersecting: lastObservation.isIntersecting
|
|
}, "*");
|
|
});
|
|
|
|
observer.observe(document.getElementById("target"));
|
|
</script>
|