document-fullscreen-enabled-setting-allowfullscreen-timing.sub.html (1124B)
1 <!DOCTYPE html> 2 <title>Document#fullscreenEnabled setting allowfullscreen after document creation, before response</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id="log"></div> 6 <script> 7 // Set allowfullscreen attribute in a timeout after <iframe> has been inserted to the document. 8 // The iframe's response is delayed so it happens after the attribute is set. 9 10 async_test((t) => { 11 const iframe = document.createElement('iframe'); 12 // no allowfullscreen attribute 13 14 const path = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 15 iframe.src = "http://{{hosts[][]}}:{{ports[http][0]}}" + path + "resources/echo-fullscreenEnabled.html?pipe=trickle(d1)"; 16 iframe.onload = t.step_func(() => { 17 iframe.contentWindow.postMessage('What is document.fullscreenEnabled?', '*'); 18 }); 19 20 window.onmessage = t.step_func_done((e) => { 21 assert_false(e.data, 'document.fullscreenEnabled in the iframe'); 22 }); 23 24 document.body.appendChild(iframe); 25 26 t.step_timeout(() => { 27 iframe.allowFullscreen = true; 28 }, 10); 29 }); 30 </script>