    assert_equals(document.activeElement, button);
}, "when reparenting an element, don't automatically 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(button));
    const inert_parent = document.querySelector("#inert_parent");
    button.focus();
    assert_equals(document.activeElement, button);
    inert_parent.moveBefore(button, null);

    