massive-element-below-and-on-top-of-viewport-partially-onscreen-new.html (2038B)
1 <!DOCTYPE html> 2 <html class=reftest-wait> 3 <title>View transitions: massive element below and on top of viewport partially onscreen (new content)</title> 4 <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> 5 <link rel="author" href="mailto:khushalsagar@chromium.org"> 6 <link rel="match" href="massive-element-below-and-on-top-of-viewport-partially-onscreen-ref.html"> 7 <meta name="fuzzy" content="maxDifference=0-2;totalPixels=0-330"> 8 9 <script src="/common/reftest-wait.js"></script> 10 <style> 11 .target { 12 position: fixed; 13 inset-block-start: -90px; 14 inline-size: 100px; 15 block-size: 40000px; 16 view-transition-name: target; 17 } 18 19 .top { 20 inline-size: 100%; 21 block-size: 100px; 22 background: lightblue; 23 } 24 25 .middle { 26 inline-size: 100%; 27 block-size: 39800px; 28 background: green; 29 } 30 31 .bottom { 32 inline-size: 100%; 33 block-size: 100px; 34 background: blue; 35 } 36 37 .hidden { 38 contain: paint; 39 inline-size: 10px; 40 block-size: 10px; 41 background: grey; 42 view-transition-name: hidden; 43 } 44 45 html::view-transition-group(hidden) { animation-duration: 300s; } 46 html::view-transition-image-pair(hidden) { animation: unset; opacity: 0; } 47 48 html::view-transition-old(*), html::view-transition-new(*) { 49 object-fit: none; 50 } 51 52 html::view-transition-old(target) { animation: unset; opacity: 0; } 53 html::view-transition-new(target) { animation: unset; opacity: 1; } 54 55 </style> 56 57 <div class="target"> 58 <div class="top">This text is at the top of the box</div> 59 <div class="middle">This text is in the middle of the box</div> 60 <div id="scrollblue" class="bottom">This text is at the bottom of the box</div> 61 </div> 62 <div id=hidden class=hidden></div> 63 64 <script> 65 failIfNot(document.startViewTransition, "Missing document.startViewTransition"); 66 67 async function runTest() { 68 document.startViewTransition(() => { 69 requestAnimationFrame(() => requestAnimationFrame(() => 70 requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)) 71 )); 72 }); 73 } 74 onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); 75 </script>