Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html class=reftest-wait>
<title>View transitions: use snapshot containing block for static position in iframe</title>
<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>