"child">
    child
  </span>
</dialog>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const dialog = document.getElementById("dialog");
const root = document.documentElement;

setup(() => {
  root.remove();
  document.append(dialog);
  dialog.showModal();
  add_completion_callback(() => {
    getSelection().removeAllRanges();
  });
});

function checkSelection(expectedText) {
  const selection = getSelection();
  selection.selectAllChildren