focus-within-013.html (1308B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Test: :focus-within selector</title> 6 <link rel="author" title="Ethan Lin" href="mailto:ethlin@mozilla.com"> 7 <link rel="author" title="Mozilla" href="https://www.mozilla.org"> 8 <link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo"> 9 <meta name="assert" content="Test checks :focus-within should not work for iframe"> 10 <link rel="match" href="focus-within-013-ref.html"> 11 <style> 12 div:focus-within { 13 border: solid 15px red; 14 } 15 iframe:focus-within { 16 border: solid 15px red; 17 } 18 </style> 19 </head> 20 <body> 21 <p>Test passes if, when the element inside the iframe is focused, there is no red border surrounded.</p> 22 <div> 23 <iframe id="iframe" src="focus-within-1.html" width="300px" height="300px" frameborder="0" tabindex="1"><p>Your browser does not support iframes.</p></iframe> 24 </div> 25 <script> 26 var iframe = document.getElementById("iframe"); 27 iframe.addEventListener("load", function() { 28 while (iframe.contentWindow.document.documentElement.classList.contains("reftest-wait")) {} 29 document.documentElement.classList.remove('reftest-wait'); 30 }); 31 </script> 32 </body> 33 </html>