summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fullscreen/api/element-ready-check-fullscreen-element-sibling.html
blob: 6394c13ee331417d49a06a21e1067615a82bae59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<title>Element ready check for sibling of fullscreen element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="../trusted-click.js"></script>
<div id="log"></div>
<div id="a"></div>
<div id="b"></div>
<script>
    promise_test(async (t) => {
        document.onfullscreenerror = t.unreached_func(
            "second fullscreenchange event"
        );
        const a = document.getElementById("a");
        const b = document.getElementById("b");
        await Promise.all([trusted_request(a), fullScreenChange()]);

        assert_equals(document.fullscreenElement, a, "fullscreen element is a");

        await Promise.all([trusted_request(b, a), fullScreenChange()]);
        assert_equals(document.fullscreenElement, b, "fullscreen element is b");
    });
</script>