OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Element#requestFullscreen() followed by moving the element into an iframe
</title> | 2 <title>Element#requestFullscreen() followed by moving the element into an 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 <div id="target"></div> | 7 <div id="target"></div> |
8 <iframe allowfullscreen></iframe> | 8 <iframe allowfullscreen></iframe> |
9 <script> | 9 <script> |
10 // Adapted from https://github.com/w3c/web-platform-tests/pull/4250 | 10 // Adapted from https://github.com/w3c/web-platform-tests/pull/4250 |
11 // TODO(foolip): Remove this test when the above is imported and passing. | 11 // TODO(foolip): Remove this test when the above is imported and passing. |
12 async_test(t => { | 12 async_test(t => { |
13 const target = document.getElementById("target"); | 13 const target = document.getElementById("target"); |
14 const iframeDoc = document.querySelector("iframe").contentDocument; | 14 const iframeDoc = document.querySelector("iframe").contentDocument; |
15 | 15 |
16 iframeDoc.onfullscreenchange = t.unreached_func("fullscreenchange event in ifr
ame"); | 16 iframeDoc.onfullscreenchange = t.unreached_func("fullscreenchange event in ifr
ame"); |
17 iframeDoc.onfullscreenerror = t.unreached_func("fullscreenerror event in ifram
e"); | 17 iframeDoc.onfullscreenerror = t.unreached_func("fullscreenerror event in ifram
e"); |
18 document.onfullscreenchange = t.step_func_done(() => { | 18 document.onfullscreenchange = t.unreached_func("fullscreenchange event"); |
| 19 document.onfullscreenerror = t.step_func_done(() => { |
19 assert_equals(document.fullscreenElement, null); | 20 assert_equals(document.fullscreenElement, null); |
20 assert_equals(iframeDoc.fullscreenElement, null); | 21 assert_equals(iframeDoc.fullscreenElement, null); |
21 }); | 22 }); |
22 document.onfullscreenerror = t.unreached_func("fullscreenerror event"); | |
23 | 23 |
24 trusted_click(t.step_func(() => { | 24 trusted_click(t.step_func(() => { |
25 target.requestFullscreen(); | 25 target.requestFullscreen(); |
26 iframeDoc.body.appendChild(target); | 26 iframeDoc.body.appendChild(target); |
27 }), document.body); | 27 }), document.body); |
28 }); | 28 }); |
29 </script> | 29 </script> |
OLD | NEW |