1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<!DOCTYPE html>
<body>
<script src="../../../resources/js-test.js"></script>
<script>
description("Tests the capture attribute of <input type='file'>");
var input = document.createElement("input");
shouldBeTrue("'capture' in input");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.setAttribute("type", "file");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.setAttribute("capture", true);
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");
input.removeAttribute("capture");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.setAttribute("capture", "'x'");
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");
input.capture = false;
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");
input.capture = true;
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");
</script>
</html>
|