         document.fullscreenElement,
            iframe,
            "outer fullscreenElement"
        );

        assert_equals(
            iframeDoc.fullscreenElement,
            iframeBody,
            "inner fullscreenElement"
        );
    }, "Checks that the fullscreenchange events fire in right order when entering fullscreen");

    promise_test(async (t) => {
        document.onfullscreenerror = t.unreached_func(
            "document fullscreenerror event"
        );
        iframeDoc.onfullscre