blob: ba92037b9c015aabde265746b9c4404281cb5394 [file] [log] [blame]
<!DOCTYPE html>
<title>Remove the single element on the fullscreen element stack</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../trusted-click.js"></script>
<div id="log"></div>
<div id="single"></div>
<script>
async_test(function(t)
{
t.add_cleanup(() => {
Promise.resolve(document.exitFullscreen()).catch(() => {});
});
var single = document.getElementById("single");
document.onfullscreenchange = t.step_func(function(event)
{
assert_equals(document.fullscreenElement, single);
assert_equals(event.target, single);
single.remove();
// Because /single/ was removed from the top layer, the fullscreen
// element becomes null synchronously.
assert_equals(document.fullscreenElement, null);
document.onfullscreenchange = t.step_func_done(function(event)
{
assert_equals(document.fullscreenElement, null);
assert_equals(event.target, document);
});
});
trusted_request(t, single);
});
</script>