scrollIntoView-target-with-contents-hidden.html (1026B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>Content Visibility: scrollIntoView should scroll when target has content-visibility: hidden</title> 5 <link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> 7 <link rel="match" href="scrollIntoView-target-with-contents-hidden-ref.html"> 8 <meta name="assert" content="scrollIntoView works properly when used on target with content-visibility: 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 #target { 19 width: 150px; 20 height: 150px; 21 background: lightgreen; 22 content-visibility: hidden; 23 } 24 </style> 25 26 <div class="spacer"></div> 27 <div id="target">FAIL</div> 28 29 <script> 30 function runTest() { 31 document.getElementById("target").scrollIntoView(); 32 requestAnimationFrame(takeScreenshot); 33 } 34 35 window.onload = () => { requestAnimationFrame(runTest); }; 36 </script> 37 </html>