servo/tests/wpt/web-platform-tests/fullscreen/model/remove-single-manual.html

29 lines
1 KiB
HTML

<!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(() => document.exitFullscreen());
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>