<!DOCTYPE html>
<html class="reftest-wait">
<title>View transitions: view-transition-name element, when captured escapes its clips even if it has an abspos child</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="match" href="content-escapes-clip-with-abspos-child-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
#clipper {
border-radius: 20px;
overflow: hidden;
width: max-content;
}
#target {
width: 100px;
height: 100px;
background: lightblue;
view-transition-name: target;
}
#abspos {
position: absolute;
left: 0;
width: 50px;
height: 50px;
background: pink;
}
:root { view-transition-name: none }
::view-transition {
background: rebeccapurple;
}
::view-transition-old(*) {
animation: unset;
opacity: 0;
}
::view-transition-new(*) {
animation: unset;
opacity: 1;
}
::view-transition-group(*) {
animation-play-state: paused;
}
</style>
<div id=clipper>
<div id=target>
<div id=abspos></div>
</div>
</div>
<script>
function runTest() {
document.startViewTransition().ready.then(takeScreenshot);
}
requestAnimationFrame(() => requestAnimationFrame(() => {
requestAnimationFrame(runTest);
}));
</script>