new-content-ancestor-clipped.html (1593B)
1 <!DOCTYPE html> 2 <html class=reftest-wait> 3 <title>View transitions: capture opacity elements</title> 4 <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> 5 <link rel="author" href="mailto:mattwoodrow@apple.com"> 6 <link rel="match" href="new-content-ancestor-clipped-ref.html"> 7 <script src="/common/reftest-wait.js"></script> 8 <style> 9 .outer { 10 background-color: blue; 11 overflow: hidden; 12 box-shadow: -50px -50px 0px 0px rgba(0,0,0,1); 13 position: relative; 14 left: 100px; 15 top: 100px; 16 width: 200px; 17 height: 200px; 18 view-transition-name: outer; 19 } 20 .inner { 21 background-color: red; 22 position: relative; 23 left: 50px; 24 top: 50px; 25 width: 200px; 26 height: 200px; 27 view-transition-name: inner; 28 } 29 /* We're verifying what we capture, so just display the new contents for 5 minutes. */ 30 html::view-transition-group(*) { animation-duration: 300s; } 31 html::view-transition-new(*) { animation: unset; opacity: 1; } 32 html::view-transition-old(*) { animation: unset; opacity: 0; } 33 /* hide the root so we show transition background to ensure we're in a transition */ 34 html::view-transition-group(root) { animation: unset; opacity: 0; } 35 html::view-transition { background: lightpink; } 36 </style> 37 <div class="outer"> 38 <div class="inner"></div> 39 </div> 40 <script> 41 failIfNot(document.startViewTransition, "Missing document.startViewTransition"); 42 43 async function runTest() { 44 let t = document.startViewTransition(() => { 45 requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)); 46 }); 47 } 48 onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); 49 </script>