summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/skip-another-top-level-browsing-context.html
blob: d392b903f075276a03189207e57d789608523de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/utils.js"></script>
<script>
'use strict';

promise_test(async () => {
  let w = window.open('resources/moving-autofocus-to-parent.html');
  await waitForLoad(w);
  await waitUntilStableAutofocusState(w);
  assert_equals(w.document.activeElement, w.document.body);
  assert_equals(document.activeElement, document.body);
  w.close();
}, 'Autofocus elements queued in another top-level browsing context\'s ' +
   'documents should be skipped.');
</script>