<!DOCTYPE html>
<html class=reftest-wait dir="rtl">
<title>View transitions: use snapshot containing block for fixed position descendants</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
<link rel="author" href="mailto:[email protected]">
<link rel="match" href="snapshot-containing-block-fixed-descendants-ref.html">
<meta name="fuzzy" content="snapshot-containing-block-fixed-descendants-ref.html:0-20;0-100">
<script src="/common/reftest-wait.js"></script>
<style>
:root {
view-transition-name: none;
background-color: red;
}
body {
height: 400vh;
}
div {
position: absolute;
left: 200px;
top: 300px;
width: 100px;
height: 100px;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
background: darkseagreen;
view-transition-name: target;
}
::view-transition-group(target) {
position: fixed;
animation-duration: 50s;
}
::view-transition {
/* Relative and shifted to ensure fixed group pseudos aren't contained by
* this pseudo */
position: relative;
display: block;
right: 100px;
top: 200px;
height: 100%;
width: 100%;
background-color: limegreen;
}
</style>
<div id="target">TARGET</div>
<script>
failIfNot(document.startViewTransition, "Missing document.startViewTransition");
async function runTest() {
let transition = document.startViewTransition();
await transition.ready;
takeScreenshot();
}
onload = () => {
// Use an left-hand side scrollbar so that the regular fixed position
// containing block differs from the snapshot containing block.
if (window.internals) {
window.internals.settings.setPlaceRTLScrollbarsOnLeftSideInMainFrame(true);
}
requestAnimationFrame(() => requestAnimationFrame(runTest));
}
</script>