| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <title>Input element value mode</title> | 3 <title>Input element value mode</title> |
| 4 <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> | 4 <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> |
| 5 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <div id="log"></div> | 7 <div id="log"></div> |
| 8 <script> | 8 <script> |
| 9 // MODE DEFAULT | 9 // MODE DEFAULT |
| 10 test(function () { | 10 test(function () { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 input.setAttribute("value", "bar"); | 75 input.setAttribute("value", "bar"); |
| 76 input.value = "foo"; | 76 input.value = "foo"; |
| 77 assert_equals(input.value, "foo"); | 77 assert_equals(input.value, "foo"); |
| 78 }, "value IDL attribute of input type button with value attribute"); | 78 }, "value IDL attribute of input type button with value attribute"); |
| 79 | 79 |
| 80 // MODE DEFAULT/ON | 80 // MODE DEFAULT/ON |
| 81 test(function () { | 81 test(function () { |
| 82 var input = document.createElement("input"); | 82 var input = document.createElement("input"); |
| 83 input.type = "checkbox"; | 83 input.type = "checkbox"; |
| 84 input.value = "foo"; | 84 input.value = "foo"; |
| 85 assert_equals(input.value, "on"); | 85 assert_equals(input.value, "foo"); |
| 86 }, "value IDL attribute of input type checkbox without value attribute"); | 86 }, "value IDL attribute of input type checkbox without value attribute"); |
| 87 test(function() { | 87 test(function() { |
| 88 var input = document.createElement("input"); | 88 var input = document.createElement("input"); |
| 89 input.type = "checkbox"; | 89 input.type = "checkbox"; |
| 90 input.setAttribute("value", "bar"); | 90 input.setAttribute("value", "bar"); |
| 91 input.value = "foo"; | 91 input.value = "foo"; |
| 92 assert_equals(input.value, "bar"); | 92 assert_equals(input.value, "foo"); |
| 93 }, "value IDL attribute of input type checkbox with value attribute"); | 93 }, "value IDL attribute of input type checkbox with value attribute"); |
| 94 | 94 |
| 95 test(function () { | 95 test(function () { |
| 96 var input = document.createElement("input"); | 96 var input = document.createElement("input"); |
| 97 input.type = "radio"; | 97 input.type = "radio"; |
| 98 input.value = "foo"; | 98 input.value = "foo"; |
| 99 assert_equals(input.value, "on"); | 99 assert_equals(input.value, "foo"); |
| 100 }, "value IDL attribute of input type radio without value attribute"); | 100 }, "value IDL attribute of input type radio without value attribute"); |
| 101 test(function() { | 101 test(function() { |
| 102 var input = document.createElement("input"); | 102 var input = document.createElement("input"); |
| 103 input.type = "radio"; | 103 input.type = "radio"; |
| 104 input.setAttribute("value", "bar"); | 104 input.setAttribute("value", "bar"); |
| 105 input.value = "foo"; | 105 input.value = "foo"; |
| 106 assert_equals(input.value, "bar"); | 106 assert_equals(input.value, "foo"); |
| 107 }, "value IDL attribute of input type radio with value attribute"); | 107 }, "value IDL attribute of input type radio with value attribute"); |
| 108 | 108 |
| 109 // MODE VALUE | 109 // MODE VALUE |
| 110 test(function () { | 110 test(function () { |
| 111 var input = document.createElement("input"); | 111 var input = document.createElement("input"); |
| 112 input.type = "text"; | 112 input.type = "text"; |
| 113 input.value = "foo"; | 113 input.value = "foo"; |
| 114 assert_equals(input.value, "foo"); | 114 assert_equals(input.value, "foo"); |
| 115 }, "value IDL attribute of input type text without value attribute"); | 115 }, "value IDL attribute of input type text without value attribute"); |
| 116 test(function() { | 116 test(function() { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 assert_equals(input.value, "#000000"); | 296 assert_equals(input.value, "#000000"); |
| 297 }, "value IDL attribute of input type color without value attribute"); | 297 }, "value IDL attribute of input type color without value attribute"); |
| 298 test(function() { | 298 test(function() { |
| 299 var input = document.createElement("input"); | 299 var input = document.createElement("input"); |
| 300 input.type = "color"; | 300 input.type = "color"; |
| 301 input.setAttribute("value", "bar"); | 301 input.setAttribute("value", "bar"); |
| 302 input.value = "foo"; | 302 input.value = "foo"; |
| 303 assert_equals(input.value, "#000000"); | 303 assert_equals(input.value, "#000000"); |
| 304 }, "value IDL attribute of input type color with value attribute"); | 304 }, "value IDL attribute of input type color with value attribute"); |
| 305 </script> | 305 </script> |
| OLD | NEW |