diff options
Diffstat (limited to 'testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/queue-non-focusable.html')
-rw-r--r-- | testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/queue-non-focusable.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/queue-non-focusable.html b/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/queue-non-focusable.html new file mode 100644 index 0000000000..e3b556035d --- /dev/null +++ b/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/queue-non-focusable.html @@ -0,0 +1,20 @@ +<!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]'); + textarea.disabled = false; + + await waitUntilStableAutofocusState(); + assert_equals(document.activeElement, textarea); + assert_not_equals(document.activeElement, select); +}, 'If the first autofocus element is not focusable, but becomes focusable before a frame, it should be focused.'); +</script> |