e just focused");

  const dialog = document.querySelector("dialog");
  assert_false(dialog.open, "Dialog should initially be closed");

  dialog.inert = true;
  test.add_cleanup(() => { dialog.inert = false; });

  if (isModal) {
    dialog.showModal();
    test.add_cleanup(() => { dialog.close(); });
    assert_equals(document.activeElement, document.body,
      "dialog.showModal(): focusing steps should apply focus fixup rule when dialog is inert");
  } else {
    dialog.show();
    test.add_cleanup(() =