content-visibility-056.html (1045B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>Content Visibility: scrollIntoView prevented</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="spacer-and-container-ref.html"> 8 <meta name="assert" content="scrollIntoView is prevented when the target is hidden"> 9 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 content-visibility: hidden; 23 } 24 #target { 25 width: 100px; 26 height: 100px; 27 background: pink; 28 } 29 </style> 30 31 <div class="spacer">Test passes if there is no red.</div> 32 <div id="container"><div id="target">FAIL</div></div> 33 34 <script> 35 function runTest() { 36 document.getElementById("target").scrollIntoView(); 37 requestAnimationFrame(takeScreenshot); 38 } 39 40 window.onload = () => { requestAnimationFrame(runTest); }; 41 </script> 42 </html>