embedded-opener-a-form.html (912B)
1 <!doctype html> 2 <title>opener and embedded documents; using a and form</title> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <div id=log></div> 6 <iframe name=matchesastring></iframe> 7 <a href=/common/blank.html target=matchesastring><a></a> 8 <form action=/common/blank.html target=matchesastring><input type=submit value="<form>"></form> 9 <script> 10 async_test(t => { 11 const frame = document.querySelector("iframe"); 12 let counter = 0; 13 frame.onload = t.step_func(() => { 14 // Firefox and Chrome/Safari load differently 15 if (frame.contentWindow.location.href === "about:blank") { 16 return; 17 } 18 19 // Test bits 20 assert_equals(frame.contentWindow.opener, null); 21 if (counter === 0) { 22 document.querySelector("input").click(); 23 } else { 24 t.done(); 25 } 26 counter++; 27 }); 28 document.querySelector("a").click(); 29 }); 30 </script>