Source code

Revision control

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: file input can be programatically focused before layout</title>
<link rel="author" title="Mozilla" href="https://mozilla.org/">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<input type="file">
<script>
test(function() {
let input = document.querySelector("input");
assert_not_equals(document.activeElement, input);
input.focus();
assert_equals(document.activeElement, input);
});
</script>