OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
| 4 <title>This test checks that assigning null to HTMLInputElement.value behaves |
| 5 correctly; i.e. as if the empty string was assigned.</title> |
4 <script src="../../../resources/testharness.js"></script> | 6 <script src="../../../resources/testharness.js"></script> |
5 <script src="../../../resources/testharnessreport.js"></script> | 7 <script src="../../../resources/testharnessreport.js"></script> |
6 <link rel="stylesheet" href="../../../resources/testharness.css"> | 8 <link rel="stylesheet" href="../../../resources/testharness.css"> |
7 </head> | 9 </head> |
8 <body> | 10 <body> |
9 <p>This test checks that assigning null to HTMLInputElement.value behaves | |
10 correctly; i.e. as if the empty string was assigned.</p> | |
11 <form style="display: none"> | 11 <form style="display: none"> |
12 <input id="text-with-default" type="text" value="default"> | 12 <input id="text-with-default" type="text" value="default"> |
13 <input id="text-without-default" type="text"> | 13 <input id="text-without-default" type="text"> |
14 <input id="hidden" type="hidden" value="value"> | 14 <input id="hidden" type="hidden" value="value"> |
15 </form> | 15 </form> |
16 <script> | 16 <script> |
17 | 17 |
18 test(function () { | 18 test(function () { |
19 var input = document.getElementById("text-with-default"); | 19 var input = document.getElementById("text-with-default"); |
20 | 20 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 input.value = null; | 53 input.value = null; |
54 | 54 |
55 assert_equals(input.value, ""); | 55 assert_equals(input.value, ""); |
56 assert_true(input.hasAttribute("value")); | 56 assert_true(input.hasAttribute("value")); |
57 assert_equals(input.getAttribute("value"), ""); | 57 assert_equals(input.getAttribute("value"), ""); |
58 }, "input[type=hidden] with value content attribute."); | 58 }, "input[type=hidden] with value content attribute."); |
59 | 59 |
60 </script> | 60 </script> |
61 </body> | 61 </body> |
62 </html> | 62 </html> |
OLD | NEW |