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/skip-not-fully-active.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>
<iframe srcdoc="<input autofocus><script>window.frameElement.remove();</script>"></iframe>
<script>
'use strict';
promise_test(async () => {
let iframe = document.querySelector('iframe');
let iframeDocument = iframe.contentDocument;
await waitForLoad(window);
assert_not_equals(document.activeElement, iframe);
assert_equals(iframeDocument.activeElement, iframeDocument.body);
}, 'Autofocus element in not-fully-active document should be skipped while flusing.');
</script>