// The button will still be considered the active element. It will blur asynchronously.
    assert_equals(document.activeElement, button);
    await eventually_blurred(t, button);
    assert_equals(document.activeElement, document.body);
}, "when reparenting a focused element into an inert parent, reset the document focus");


promise_test(async t => {
    const old_parent = document.querySelector("#old_parent");
    const button = document.querySelector("#button");
    t.add_cleanup(() => old_parent.append