OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Element#requestFullscreen() followed by moving the element within the doc
ument</title> | 2 <title>Element#requestFullscreen() followed by moving the element within the doc
ument</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 <div id="moveto"></div> | 8 <div id="moveto"></div> |
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 moveTo = document.getElementById("moveto"); | 14 const moveTo = document.getElementById("moveto"); |
15 | 15 |
16 document.onfullscreenchange = t.step_func_done(() => { | 16 document.onfullscreenchange = t.step_func_done(() => { |
17 assert_equals(document.fullscreenElement, null); | 17 assert_equals(document.fullscreenElement, target); |
18 assert_equals(target.parentNode, moveTo); | 18 assert_equals(target.parentNode, moveTo); |
19 }); | 19 }); |
20 document.onfullscreenerror = t.unreached_func("fullscreenchange event"); | 20 document.onfullscreenerror = t.unreached_func("fullscreenchange event"); |
21 | 21 |
22 trusted_click(t.step_func(() => { | 22 trusted_click(t.step_func(() => { |
23 target.requestFullscreen(); | 23 target.requestFullscreen(); |
24 moveTo.appendChild(target); | 24 moveTo.appendChild(target); |
25 }), document.body); | 25 }), document.body); |
26 }); | 26 }); |
27 </script> | 27 </script> |
OLD | NEW |