(button));
    const hidden_parent = document.querySelector("#hidden_parent");
    button.focus();
    assert_equals(document.activeElement, button);
    hidden_parent.moveBefore(button, null);

    // The button will still be considered the active element. It will blur asynchronously.
    // This is similar to other operations that can cause a blur due to change in inert trees,
    // e.g. a style change that makes an ancestor `display: none`.
    assert_equals(document.activeElement, button);
    await ev