OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
3 <script> | 3 <script> |
4 description('Tests for writing and reading .type property of HTMLInputElement.')
; | 4 description('Tests for writing and reading .type property of HTMLInputElement.')
; |
5 | 5 |
6 var input = document.createElement('input'); | 6 var input = document.createElement('input'); |
7 | 7 |
8 // The default type is "text". | 8 // The default type is "text". |
9 shouldBe('input.type', '"text"'); | 9 shouldBe('input.type', '"text"'); |
10 shouldBeNull("input.getAttribute('type')"); | 10 shouldBeNull("input.getAttribute('type')"); |
(...skipping 14 matching lines...) Expand all Loading... |
25 else | 25 else |
26 testFailed('input.getAttribute("type") for "' + value + '" is incorrectl
y "' + input.getAttribute('type') + '", should be "' + expectedAttributeValue +
'".'); | 26 testFailed('input.getAttribute("type") for "' + value + '" is incorrectl
y "' + input.getAttribute('type') + '", should be "' + expectedAttributeValue +
'".'); |
27 } | 27 } |
28 | 28 |
29 check("text", "text"); | 29 check("text", "text"); |
30 check("TEXT", "text", "TEXT"); // input.type must return a lower case value acc
ording to DOM Level 2. | 30 check("TEXT", "text", "TEXT"); // input.type must return a lower case value acc
ording to DOM Level 2. |
31 check(" text ", "text", " text "); | 31 check(" text ", "text", " text "); |
32 check("button", "button"); | 32 check("button", "button"); |
33 check(" button ", "text", " button "); | 33 check(" button ", "text", " button "); |
34 check("checkbox", "checkbox"); | 34 check("checkbox", "checkbox"); |
| 35 check("chec\u212Abox", "text", "chec\u212Abox"); |
35 check("email", "email"); | 36 check("email", "email"); |
36 check("file", "file"); | 37 check("file", "file"); |
37 check("hidden", "hidden"); | 38 check("hidden", "hidden"); |
38 check("image", "image"); | 39 check("image", "image"); |
39 check("isindex", "text", "isindex"); | 40 check("isindex", "text", "isindex"); |
40 check("number", "number"); | 41 check("number", "number"); |
41 check("password", "password"); | 42 check("password", "password"); |
42 check("passwd", "text", "passwd"); | 43 check("passwd", "text", "passwd"); |
43 check("radio", "radio"); | 44 check("radio", "radio"); |
44 check("range", "range"); | 45 check("range", "range"); |
(...skipping 21 matching lines...) Expand all Loading... |
66 | 67 |
67 debug("Changing the type to file should discard the dirty value."); | 68 debug("Changing the type to file should discard the dirty value."); |
68 input = document.createElement("input"); | 69 input = document.createElement("input"); |
69 input.setAttribute("value", "DEFAULT"); | 70 input.setAttribute("value", "DEFAULT"); |
70 input.value = "DIRTY"; | 71 input.value = "DIRTY"; |
71 input.type = "file"; | 72 input.type = "file"; |
72 input.type = "text"; | 73 input.type = "text"; |
73 shouldBe("input.value", "input.getAttribute('value')"); | 74 shouldBe("input.value", "input.getAttribute('value')"); |
74 | 75 |
75 </script> | 76 </script> |
OLD | NEW |