<!DOCTYPE html>
<title>moveBefore should not automatically clear focus</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<section id="old_parent">
<button id="button" tabindex="1">Button</button>
</section>
<section id="new_parent">
</section>
<section id="inert_parent" inert>
</section>
<section id="hidden_parent" hidden>
</section>
<script>

function eventually_blurred(t, item, timeout = 1000) {
    return new Promise((resolve, reject)