OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Element#requestFullscreen() on two elements in different iframes</title> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script src="../trusted-click.js"></script> |
| 6 <div id="log"></div> |
| 7 <iframe id="a" allowfullscreen></iframe> |
| 8 <iframe id="b" allowfullscreen></iframe> |
| 9 <script> |
| 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. |
| 12 async_test(t => { |
| 13 // Request fullscreen on the body elements of both iframes, but in reverse |
| 14 // tree order. |
| 15 const a = document.getElementById('a'); |
| 16 const b = document.getElementById('b'); |
| 17 |
| 18 // Expect first a fullscreenchange event for the second (!) request, then a |
| 19 // fullscreenerror event for the first request. TODO(foolip): Remove the |
| 20 // Fullscreen hierarchy restrictions. https://crbug.com/627792 |
| 21 a.contentDocument.onfullscreenerror = t.step_func(() => { |
| 22 b.contentDocument.onfullscreenchange = t.step_func_done(() => { |
| 23 assert_equals(document.fullscreenElement, b, 'fullscreenElement'); |
| 24 assert_equals(a.contentDocument.fullscreenElement, null, 'fullscreenElemen
t in iframe a'); |
| 25 assert_equals(b.contentDocument.fullscreenElement, b.contentDocument.body,
'fullscreenElement in iframe b'); |
| 26 }); |
| 27 }); |
| 28 a.contentDocument.onfullscreenchange = t.unreached_func('fullscreenchange even
t in iframe a'); |
| 29 b.contentDocument.onfullscreenerror = t.unreached_func('fullscreenerror event
in iframe b'); |
| 30 |
| 31 trusted_click(t.step_func(() => { |
| 32 b.contentDocument.body.requestFullscreen(); |
| 33 a.contentDocument.body.requestFullscreen(); |
| 34 }), document.body); |
| 35 }); |
| 36 </script> |
OLD | NEW |