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/scroller-with-child.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class=reftest-wait>
<head>
<link rel="match" href="scroller-with-child-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="/web-animations/testcommon.js"></script>
<style>
body { margin: 20px; font: 18pt monospace; line-height: 30px; }
#scope { overflow: auto; contain: layout; padding: 20px;
width: 200px; height: 100px; border: 20px solid #acf; }
#part { view-transition-name: foo;
background: #fea; padding: 10px; border: 4px solid orange;
width: 150px; height: 180px; margin: 20px 0 0 90px; }
#scope::view-transition-group(*) { animation-play-state: paused; }
#scope::view-transition-new(*) { animation: unset; opacity: 1; }
#scope::view-transition-old(*) { animation: unset; opacity: 0; }
</style>
</head>
<body>
<div id=scope>Hello
<div id=part>child</div>
</div>
<script>
failIfNot(scope.startViewTransition, "Missing element.startViewTransition");
async function runTest() {
scope.scrollBy(40, 24);
await waitForCompositorReady();
const t = scope.startViewTransition(() => {
scope.firstChild.nodeValue = "World";
part.style.background = "#fac";
});
await t.ready;
takeScreenshot();
}
onload = () => runTest();
</script>
</body>
</html>