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