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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 check("submit", "submit"); | 47 check("submit", "submit"); |
48 check("tel", "tel"); | 48 check("tel", "tel"); |
49 check("telephone", "text", "telephone"); | 49 check("telephone", "text", "telephone"); |
50 check("url", "url"); | 50 check("url", "url"); |
51 check("uri", "text", "uri"); | 51 check("uri", "text", "uri"); |
52 | 52 |
53 // Empty and unknown value handling. | 53 // Empty and unknown value handling. |
54 check("", "text", ""); | 54 check("", "text", ""); |
55 check("x-unknown", "text", "x-unknown"); | 55 check("x-unknown", "text", "x-unknown"); |
56 shouldBeNull("input.removeAttribute('type'); input.getAttribute('type')"); | 56 shouldBeNull("input.removeAttribute('type'); input.getAttribute('type')"); |
| 57 |
| 58 debug("Check dirty flag behavior"); |
| 59 input = document.createElement("input"); |
| 60 input.type = "hidden"; |
| 61 input.defaultValue = "Default"; |
| 62 input.type = "text"; |
| 63 // The dirty flag should be still false, and the defaultValue should be reflecte
d |
| 64 // to value. |
| 65 shouldBeEqualToString("input.defaultValue = 'UpdatedDefault'; input.value", "Upd
atedDefault"); |
57 </script> | 66 </script> |
OLD | NEW |