<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8" />
<title>Dialog-Popover crash</title>
<link rel="author" href="mailto:masonf@chromium.org">
<link rel=help href="https://open-ui.org/components/popover.research.explainer">
<link rel=help href="https://html.spec.whatwg.org/multipage/popover.html">
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/popover-utils.js"></script>

<p>This test passes if it does not crash.</p>
<dialog popover>This is a modal dialog</dialog>
<div popover>This is a popover</div>

<script>
  const dialog = document.querySelector('dialog[popover]');
  const popover = document.querySelector('div[popover]');
  dialog.showModal();
  popover.showPopover();
  clickOn(dialog)
    .then(() => {
      document.documentElement.classList.remove("reftest-wait");
    });
</script>
