Files
sousa-gecko/testing/web-platform/tests/intersection-observer/transformed-iframe-002-same-origin.html
T
Kiet Ho c2806e3af1 Bug 2044929 [wpt PR 60379] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=315779, a=testonly
Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=315779

--

wpt-commits: a61ae98d79237f84e9968b1363aac61db31ccf87
wpt-pr: 60379
2026-06-09 18:47:49 +00:00

62 lines
1.5 KiB
HTML

<!DOCTYPE html>
<title>Intersection Observer: implicit root observer in iframe works when the iframe is transformed</title>
<link rel="author" title="Kiet Ho" href="mailto:kiet.ho@apple.com">
<script src="/common/rendering-utils.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#iframe {
width: 300px;
height: 300px;
display: block;
transform: perspective(600px) rotateY(-45deg) rotateX(80deg) rotateZ(20deg);
}
.spacer {
height: 2000px;
}
</style>
<p>Text to reproduce the issue.</p>
<iframe id="iframe"></iframe>
<div class="spacer"></div>
<script>
isIntersecting = null;
window.addEventListener("message", event => {
isIntersecting = event.data.isIntersecting;
});
function loadFrame() {
return new Promise(resolve => {
iframe.addEventListener("load", resolve, { once: true });
iframe.src = "resources/transformed-iframe-subframe.html";
});
}
promise_test(async (t) => {
await loadFrame();
window.scrollTo(0, 0);
await waitForAtLeastOneFrame();
await waitForAtLeastOneFrame();
await waitForAtLeastOneFrame();
assert_true(isIntersecting);
}, "Target is initially visible");
promise_test(async (t) => {
window.scrollTo(0, 250);
await waitForAtLeastOneFrame();
await waitForAtLeastOneFrame();
await waitForAtLeastOneFrame();
assert_false(isIntersecting);
}, "Scroll such that target is just out of view, target is not visible");
</script>