new-content-ancestor-clipped-2.html (1465B)
1 <!DOCTYPE html> 2 <html class=reftest-wait> 3 <title>View transitions: clips from ancestor elements are not applied to captures</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-2-ref.html"> 7 <script src="/common/reftest-wait.js"></script> 8 <style> 9 .outer { 10 background-color: blue; 11 overflow: hidden; 12 position: relative; 13 left: 100px; 14 top: 100px; 15 width: 200px; 16 height: 200px; 17 } 18 .inner { 19 background-color: red; 20 position: relative; 21 left: 50px; 22 top: 50px; 23 width: 200px; 24 height: 200px; 25 view-transition-name: inner; 26 } 27 /* We're verifying what we capture, so just display the new contents for 5 minutes. */ 28 html::view-transition-group(*) { animation-duration: 300s; } 29 html::view-transition-new(*) { animation: unset; opacity: 1; } 30 html::view-transition-old(*) { animation: unset; opacity: 0; } 31 /* hide the root so we show transition background to ensure we're in a transition */ 32 html::view-transition-group(root) { animation: unset; opacity: 0; } 33 html::view-transition { background: lightpink; } 34 </style> 35 <div class="outer"> 36 <div class="inner"></div> 37 </div> 38 <script> 39 async function runTest() { 40 let t = document.startViewTransition(() => { 41 requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)); 42 }); 43 } 44 onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); 45 </script>