2 <title>Fully exit fullscreen with two elements on stack and iframe
</title>
3 <script src=
"../../resources/testharness.js"></script>
4 <script src=
"../../resources/testharnessreport.js"></script>
5 <script src=
"../trusted-event.js"></script>
6 <script src=
"fully-exit-fullscreen.js"></script>
9 <iframe allowfullscreen
></iframe>
12 async_test(function(t
)
14 var iframe
= document
.querySelector("iframe");
15 var iframeDocument
= iframe
.contentDocument
;
16 var iframeBody
= iframeDocument
.body
;
17 var div
= iframe
.parentNode
;
19 document
.onfullscreenchange
= t
.step_func(function()
21 assert_equals(document
.fullscreenElement
, div
);
22 assert_equals(iframeDocument
.fullscreenElement
, null);
23 trusted_request(iframeBody
, div
);
24 document
.onfullscreenchange
= null;
25 iframeDocument
.onfullscreenchange
= t
.step_func(function()
27 assert_equals(document
.fullscreenElement
, iframe
);
28 assert_equals(iframeDocument
.fullscreenElement
, iframeBody
);
29 trusted_event(fully_exit_fullscreen
.bind(null, iframeDocument
), iframeBody
);
30 iframeDocument
.onfullscreenchange
= null;
31 document
.onfullscreenchange
= t
.step_func(function()
33 assert_equals(document
.fullscreenElement
, null);
34 assert_equals(iframe
.contentDocument
.fullscreenElement
, null);