hidden-until-found-007.html (1153B)
1 <!doctype HTML> 2 3 <html class="reftest-wait"> 4 <meta charset="utf8"> 5 <title>hidden=until-found + focus</title> 6 <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/interaction.html#attr-hidden-until-found"> 8 <link rel="match" href="./resources/spacer-and-container-ref.html"> 9 <meta name="assert" content="focus does not scroll or focus element under hidden=until-found"> 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: lightblue; 22 } 23 #target { 24 position: relative; 25 top: 75px; 26 27 width: 50px; 28 height: 50px; 29 background: red; 30 } 31 </style> 32 33 <div class=spacer></div> 34 <div id=container hidden=until-found> 35 <div id=target tabindex=0></div> 36 </div> 37 38 <script> 39 function runTest() { 40 document.getElementById("target").focus(); 41 requestAnimationFrame(takeScreenshot); 42 } 43 44 window.onload = requestAnimationFrame(() => { 45 requestAnimationFrame(() => { 46 requestAnimationFrame(() => { 47 runTest(); 48 }); 49 }); 50 }); 51 </script> 52 </html>