on</button>

<dialog id=dialog>
  <button id=b1>button</button>
  <div id=popover popover=auto>popover</div>
</dialog>

<script>
promise_test(async t => {
  const events = [];
  const closeWatcher = createRecordingCloseWatcher(t, events, 'CloseWatcher', 'CloseWatcher');
  const dialog = createRecordingCloseWatcher(t, events, 'dialog', 'dialog');
  const popover = createRecordingCloseWatcher(t, events, 'popover', 'popover');
  assert_true(dialog.hasAttribute('open'), 'The dialog should be open.');
  assert_t