content-visibility-055.html (1027B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>Content Visibility: anchor links 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-scrolled-ref.html"> 8 <meta name="assert" content="anchor link scroll not prevented when the target is hidden and activatable"> 9 10 <script src="/common/reftest-wait.js"></script> 11 12 <style> 13 .spacer { 14 width: 150px; 15 height: 300vh; 16 background: lightblue; 17 } 18 #container { 19 width: 150px; 20 height: 150px; 21 background: green; 22 content-visibility: auto; 23 } 24 25 #target { 26 width: 150px; 27 height: 100px; 28 } 29 </style> 30 31 <div class="spacer"></div> 32 <div id="container"><div id="target">Test passes if this is on screen.</div></div> 33 34 <script> 35 function runTest() { 36 location.href += "#target"; 37 requestAnimationFrame(takeScreenshot); 38 } 39 40 window.onload = () => { requestAnimationFrame(runTest); }; 41 </script> 42 </html>