content-visibility-074.html (1550B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>CSS Content Visibility: toggling auto with composited descedant</title> 5 <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> 6 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> 7 <link rel="match" href="content-visibility-074-ref.html"> 8 <meta name="assert" content="after toggling content-visibility auto a few times, composited descedant is visible."> 9 10 <script src="/common/reftest-wait.js"></script> 11 12 <style> 13 #a { will-change: transform; } 14 #b { height: 15000px; } 15 #c { 16 width: 800px; 17 height: 600px; 18 } 19 #d { 20 will-change: transform; 21 top: 0px; 22 width: 500px; 23 height: 500px; 24 background: green; 25 } 26 .auto { 27 content-visibility: auto; 28 } 29 30 </style> 31 32 <div id="a"> 33 </div> 34 <div id="b"> 35 <div id="c" class=auto> 36 <div id="d"></div> 37 </div> 38 </div> 39 </div> 40 41 <script> 42 function runTest(step) { 43 if (step % 2 == 0) { 44 requestAnimationFrame(() => runTest(step + 1)); 45 return; 46 } 47 48 switch(step) { 49 case 1: 50 document.getElementById("c").classList.remove("auto"); 51 break; 52 case 3: 53 document.getElementById("c").classList.add("auto"); 54 break; 55 case 5: 56 document.getElementById("c").classList.remove("auto"); 57 break; 58 case 7: 59 document.getElementById("c").classList.add("auto"); 60 break; 61 case 9: 62 takeScreenshot(); 63 return; 64 } 65 requestAnimationFrame(() => runTest(step + 1)); 66 } 67 68 window.onload = () => requestAnimationFrame(() => runTest(0)); 69 </script>