blob: 32008b3019e905488c35ea432de396a2641cb61a [file] [log] [blame]
<!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.');
</script>