Automatic update from web-platform-tests WebKit export of https://bugs.webkit.org/show_bug.cgi?id=305160 -- wpt-commits: be6f1e1782308f29f15c3c914ed1a5a9ffb0ec3c wpt-pr: 60614
61 lines
1.4 KiB
HTML
61 lines
1.4 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: rotateX(90deg);
|
|
}
|
|
|
|
.spacer {
|
|
height: 2000px;
|
|
}
|
|
</style>
|
|
|
|
<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_false(isIntersecting);
|
|
}, "Target is not visible as it's rotated perpendicularly to viewport");
|
|
|
|
promise_test(async (t) => {
|
|
window.scrollTo(0, 250);
|
|
|
|
await waitForAtLeastOneFrame();
|
|
await waitForAtLeastOneFrame();
|
|
await waitForAtLeastOneFrame();
|
|
|
|
assert_false(isIntersecting);
|
|
}, "Scroll down a bit, target is still not visible");
|
|
</script>
|