OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Element ready check for child of a fullscreen iframe</title> | 2 <title>Element ready check for child of a fullscreen iframe</title> |
3 <script src="/resources/testharness.js"></script> | 3 <script src="/resources/testharness.js"></script> |
4 <script src="/resources/testharnessreport.js"></script> | 4 <script src="/resources/testharnessreport.js"></script> |
5 <script src="../trusted-click.js"></script> | 5 <script src="../trusted-click.js"></script> |
6 <div id="log"></div> | 6 <div id="log"></div> |
7 <iframe><!-- script inserts div here --></iframe> | 7 <iframe><!-- script inserts div here --></iframe> |
8 <script> | 8 <script> |
9 // Verify that an iframe can itself go fullscreen, and that this doesn't | 9 // Verify that an iframe can itself go fullscreen, and that this doesn't |
10 // influence the iframe ancestor test of the element ready check. | 10 // influence the iframe ancestor test of the element ready check. |
11 async_test(t => { | 11 async_test(t => { |
12 var iframe = document.querySelector("iframe"); | 12 var iframe = document.querySelector("iframe"); |
13 | 13 |
14 document.onfullscreenchange = t.step_func(() => { | 14 document.onfullscreenchange = t.step_func(() => { |
15 assert_equals(document.fullscreenElement, iframe, "fullscreen element"); | 15 assert_equals(document.fullscreenElement, iframe, "fullscreen element"); |
16 | 16 |
17 // This adds the div to the iframe element itself, not to the iframe's | 17 // This adds the div to the iframe element itself, not to the iframe's |
18 // contentDocument. It's done here because the HTML parser treats the | 18 // contentDocument. It's done here because the HTML parser treats the |
19 // content of iframe as a text node. | 19 // content of iframe as a text node. |
20 var div = document.createElement("div"); | 20 var div = document.createElement("div"); |
21 iframe.appendChild(div); | 21 iframe.appendChild(div); |
22 | 22 |
23 document.onfullscreenchange = t.step_func_done(() => { | 23 document.onfullscreenchange = t.step_func_done(() => { |
24 assert_equals(document.fullscreenElement, div); | 24 assert_equals(document.fullscreenElement, div); |
25 }); | 25 }); |
26 document.onfullscreenerror = t.unreached_func("fullscreenerror event"); | 26 document.onfullscreenerror = t.unreached_func("fullscreenerror event"); |
27 | 27 |
28 trusted_request(div, iframe.contentDocument.body); | 28 trusted_request(t, div, iframe.contentDocument.body); |
29 }); | 29 }); |
30 | 30 |
31 trusted_request(iframe); | 31 trusted_request(t, iframe); |
32 }); | 32 }); |
33 </script> | 33 </script> |
OLD | NEW |