1
0
Fork 0
firefox/testing/web-platform/tests/css/css-view-transitions/snapshot-containing-block-static-iframe.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

55 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html class=reftest-wait>
<title>View transitions: use snapshot containing block for static position in iframe</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/#snapshot-containing-block-concept/">
<link rel="match" href="snapshot-containing-block-static-iframe-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<style>
#inner {
width: 400px;
height: 200px;
}
</style>
<iframe id="inner" srcdoc="
<style>
body {
height: 200vh;
overflow: hidden;
}
::view-transition {
position: static;
display: block;
width: 100%;
height: 100%;
background: limegreen;
}
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-old(*),
::view-transition-new(*) {
animation-play-state: paused;
}
</style>
<body></body>
"></iframe>
<script>
failIfNot(document.startViewTransition, "Missing document.startViewTransition");
async function runTest() {
// Start the view transition at a scroll offset so that the snapshot
// containing block differs from the initial containing block.
inner.contentWindow.scrollTo(0, 100);
await waitForAtLeastOneFrame();
const contentDocument = inner.contentDocument;
let vt = inner.contentDocument.startViewTransition();
await vt.ready;
takeScreenshot();
}
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script>