Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-view-transitions/new-content-escapes-clip-with-abspos-child.html - WPT Dashboard Interop Dashboard
<!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="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>