Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/interaction/focus/the-autofocus-attribute/autofocus-in-not-fully-active-document.html - WPT Dashboard Interop Dashboard
<!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 doc = document.cloneNode(false);
doc.appendChild(doc.createElement('html'))
doc.firstChild.innerHTML = '<body><input autofocus/></body>';
await waitUntilStableAutofocusState();
assert_equals(doc.activeElement, doc.body);
}, 'Autofocus element in not-fully-active document should not be queued.');
</script>