OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Document#exitFullscreen() for nested fullscreen</title> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script src="../trusted-click.js"></script> |
| 6 <div><div></div></div> |
| 7 <script> |
| 8 async_test(t => { |
| 9 const outer = document.querySelector("div"); |
| 10 const inner = outer.firstChild; |
| 11 |
| 12 // First request fullscreen for the outer element. |
| 13 trusted_request(t, outer); |
| 14 document.onfullscreenchange = t.step_func(() => { |
| 15 assert_equals(document.fullscreenElement, outer); |
| 16 |
| 17 // Then request fullscreen for the inner element. |
| 18 trusted_request(t, inner); |
| 19 document.onfullscreenchange = t.step_func(() => { |
| 20 assert_equals(document.fullscreenElement, inner); |
| 21 |
| 22 // Now exit fullscreen. |
| 23 document.exitFullscreen(); |
| 24 document.onfullscreenchange = t.step_func_done(() => { |
| 25 assert_equals(document.fullscreenElement, outer); |
| 26 }); |
| 27 }); |
| 28 }); |
| 29 document.onfullscreenerror = t.unreached_func("fullscreenerror event"); |
| 30 }); |
| 31 </script> |
OLD | NEW |