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/box-decoration-painting.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<meta name="title" content="Scoped VT: border and box shadow root painting">
<meta name="author" content="mailto:vmpstr@chromium.org">
<link rel="match" href="box-decoration-painting-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="/web-animations/testcommon.js"></script>
<style>
#target {
position: relative;
top: 30px;
left: 30px;
width: 200px;
height: 300px;
background: blue;
border-width: 5px 10px 15px 20px;
border-style: solid;
border-color: yellow;
box-shadow: 10px 5px 0px 20px black;
}
/* This is needed since we inherit from the scope and make the scope
not visible in the VT callback
*/
::view-transition { visibility: visible; }
::view-transition-group(*) {
animation-play-state: paused;
}
::view-transition-old(*) {
animation: unset;
opacity: 1;
}
::view-transition-new(*) {
animation: unset;
opacity: 0;
}
#target.after {
visibility: hidden;
}
</style>
<div id=target></div>
<script>
failIfNot(target.startViewTransition, "Missing element.startViewTransition");
function runTest() {
target.startViewTransition(() => {
target.classList.add("after");
}).ready.then(takeScreenshot);
}
waitForCompositorReady().then(runTest);
</script>