Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html class="reftest-wait">
<title>View Transitions: Target in scrolled container capture position</title>
<link rel="match" href="target-in-scrolled-container-ref.html">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/common/reftest-wait.js"></script>
<script src="/web-animations/testcommon.js"></script>
<style>
#scroller {
width: 200px;
height: 200px;
overflow: scroll;
background: lightgray;
}
#target {
width: 50px;
height: 50px;
background: green;
margin-top: 100px;
view-transition-name: target;
}
#spacer {
height: 200px;
}
html::view-transition-group(*) { animation-play-state: paused; }
html::view-transition-old(*) { animation: none; opacity: 1; }
html::view-transition-new(*) { animation: none; opacity: 0; }
</style>
<div id="scroller">
<div id="target"></div>
<div id="spacer"></div>
</div>
<script>
function runTest() {
scroller.scrollTop = 50;
target.startViewTransition().ready.then(takeScreenshot);
}
waitForCompositorReady().then(runTest);
</script>
</html>