content-visibility-062.html (1228B)
1 <!doctype HTML> 2 3 <html class="reftest-wait"> 4 <meta charset="utf8"> 5 <title>CSS Content Visibility: auto + scrollIntoView on display:none</title> 6 <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> 7 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> 8 <link rel="match" href="spacer-and-container-ref.html"> 9 <meta name="assert" content="scrollIntoView ignores display:none element in an auto subtree"> 10 <script src="/common/reftest-wait.js"></script> 11 12 <style> 13 .spacer { 14 width: 150px; 15 height: 3000px; 16 background: lightblue; 17 } 18 #container { 19 width: 150px; 20 height: 150px; 21 background: red; 22 } 23 #target { 24 display: none; 25 26 position: relative; 27 top: 75px; 28 29 width: 50px; 30 height: 50px; 31 background: pink; 32 } 33 .auto { 34 content-visibility: auto; 35 } 36 </style> 37 38 <div class=spacer>Test passes if there is no red.</div> 39 <div id=container class=auto> 40 <div id=target>FAIL</div> 41 </div> 42 43 <script> 44 function runTest() { 45 document.getElementById("target").scrollIntoView(); 46 requestAnimationFrame(takeScreenshot); 47 } 48 49 window.onload = requestAnimationFrame(() => { 50 requestAnimationFrame(() => { 51 requestAnimationFrame(() => { 52 runTest(); 53 }); 54 }); 55 }); 56 </script> 57 </html>