Files
sousa-gecko/testing/web-platform/tests/intersection-observer/resources/root-margin-in-same-origin-iframe-subframe.html
T
Kiet Ho bbd62294ed Bug 2041297 [wpt PR 60041] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=314778, a=testonly
Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=314778

--

wpt-commits: 1e98f48e81b20e7bf91fcdf6e0a8319558bd6254
wpt-pr: 60041
2026-05-29 15:57:17 +00:00

34 lines
601 B
HTML

<!DOCTYPE html>
<style>
body {
margin: 0;
padding: 0;
}
#target {
position: absolute;
height: 40px;
width: 40px;
background-color: green;
}
</style>
<div id="target"></div>
<script>
let options = {
rootMargin: '40px 0px 0px 0px',
threshold: [1]
}
let observer = new IntersectionObserver((observations) => {
const lastObservation = observations[observations.length - 1];
window.top.postMessage({
isIntersecting: lastObservation.isIntersecting
}, "*");
}, options);
observer.observe(document.getElementById("target"));
</script>