summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/interaction/focus/focus-file-input.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/interaction/focus/focus-file-input.html')
-rw-r--r--testing/web-platform/tests/html/interaction/focus/focus-file-input.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/interaction/focus/focus-file-input.html b/testing/web-platform/tests/html/interaction/focus/focus-file-input.html
new file mode 100644
index 0000000000..d3007112ff
--- /dev/null
+++ b/testing/web-platform/tests/html/interaction/focus/focus-file-input.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTML Test: file input can be programatically focused before layout</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#focus">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=505355">
+<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>