on);
    hidden_parent.moveBefore(old_parent, null);

    // 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 an ancestor of an focused element into a hidden parent, reset the document focus");
</script>
