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/scoped/clip-on-target-in-callback.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class=reftest-wait>
<title>View Transitions: Clip on target in callback does not clip root</title>
<link rel="match" href="clip-on-target-in-callback-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>
#container {
width: 200px;
height: 200px;
background: blue;
border: 5px solid black;
}
#container.after {
overflow: clip;
}
#target {
margin-top: 150px;
width: 100px;
height: 100px;
background: green;
view-transition-name: target;
}
html::view-transition-group(*) { animation-play-state: paused; }
html::view-transition-old(*) { animation: none; opacity: 0; }
html::view-transition-new(*) { animation: none; opacity: 1; }
</style>
<div id="container">
<div id="target"></div>
</div>
<script>
function runTest() {
container.startViewTransition(() => {
container.classList.add("after");
}).ready.then(takeScreenshot);
}
waitForCompositorReady().then(runTest);
</script>
</body>
</html>