summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/skip-non-focusable.html
blob: 008371d8e163fbdec937e29435fe61dffd520cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/utils.js"></script>

<textarea autofocus disabled></textarea>
<select autofocus></select>

<script>
'use strict';

promise_test(async () => {
  const [textarea, select] = document.querySelectorAll('[autofocus]');

  await waitUntilStableAutofocusState();
  assert_not_equals(document.activeElement, textarea);
  assert_equals(document.activeElement, select);
}, 'Non-focusable autofocus element is skipped.');
</script>