| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
| 3 <title>HTML Test: Resetting a form</title> | 3 <title>HTML Test: Resetting a form</title> |
| 4 <link rel="author" title="Intel" href="http://www.intel.com/"> | 4 <link rel="author" title="Intel" href="http://www.intel.com/"> |
| 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#concept-form-rese
t"> | 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#concept-form-rese
t"> |
| 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/#category-reset"> | 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/#category-reset"> |
| 7 <script src="/resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <div id="log"></div> | 9 <div id="log"></div> |
| 10 <form name="fm1" style="display:none"> | 10 <form name="fm1" style="display:none"> |
| 11 <input value="abc" id="ipt1" /> | 11 <input value="abc" id="ipt1" /> |
| 12 <input id="ipt2" /> | 12 <input id="ipt2" /> |
| 13 <input type="radio" id="rd1" checked="checked" /> | 13 <input type="radio" id="rd1" checked="checked" /> |
| 14 <input type="radio" id="rd2"/> | 14 <input type="radio" id="rd2"/> |
| 15 <input type="checkbox" id="cb1" checked="checked" /> | 15 <input type="checkbox" id="cb1" checked="checked" /> |
| 16 <input type="checkbox" id="cb2" /> | 16 <input type="checkbox" id="cb2" /> |
| 17 <textarea id="ta">abc</textarea> | 17 <textarea id="ta">abc</textarea> |
| 18 <!--<keygen id="kg"></keygen>--> | |
| 19 <output id="opt">5</output> | 18 <output id="opt">5</output> |
| 20 <select id="slt1"> | 19 <select id="slt1"> |
| 21 <option value="1">ITEM1</option> | 20 <option value="1">ITEM1</option> |
| 22 <option value="2">ITEM2</option> | 21 <option value="2">ITEM2</option> |
| 23 </select> | 22 </select> |
| 24 <select id="slt2"> | 23 <select id="slt2"> |
| 25 <option value="1">ITEM1</option> | 24 <option value="1">ITEM1</option> |
| 26 <option value="2" selected>ITEM2</option> | 25 <option value="2" selected>ITEM2</option> |
| 27 </select> | 26 </select> |
| 28 <select id="slt3" multiple> | 27 <select id="slt3" multiple> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 setPreconditions("Setting preconditions for resetting " + description); | 106 setPreconditions("Setting preconditions for resetting " + description); |
| 108 reset(); | 107 reset(); |
| 109 assert_true(document.getElementById("slt1").options[0].selected, "The first
option in the select element should be selected."); | 108 assert_true(document.getElementById("slt1").options[0].selected, "The first
option in the select element should be selected."); |
| 110 assert_false(document.getElementById("slt1").options[1].selected, "The secon
d option in the select element should not be selected."); | 109 assert_false(document.getElementById("slt1").options[1].selected, "The secon
d option in the select element should not be selected."); |
| 111 assert_false(document.getElementById("slt2").options[0].selected, "The first
option in the select element should not be selected."); | 110 assert_false(document.getElementById("slt2").options[0].selected, "The first
option in the select element should not be selected."); |
| 112 assert_true(document.getElementById("slt2").options[1].selected, "The second
option in the select element should be selected."); | 111 assert_true(document.getElementById("slt2").options[1].selected, "The second
option in the select element should be selected."); |
| 113 assert_false(document.getElementById("slt3").options[0].selected, "The first
option in the select element with multiple attribute should not be selected."); | 112 assert_false(document.getElementById("slt3").options[0].selected, "The first
option in the select element with multiple attribute should not be selected."); |
| 114 assert_true(document.getElementById("slt3").options[1].selected, "The second
option in the select element with multiple attribute should be selected."); | 113 assert_true(document.getElementById("slt3").options[1].selected, "The second
option in the select element with multiple attribute should be selected."); |
| 115 assert_true(document.getElementById("slt3").options[2].selected, "The third
option in the select element with multiple attribute should be selected."); | 114 assert_true(document.getElementById("slt3").options[2].selected, "The third
option in the select element with multiple attribute should be selected."); |
| 116 }, "Resetting <select> " + description); | 115 }, "Resetting <select> " + description); |
| 117 //TODO: The keygen reset algorithm | |
| 118 } | 116 } |
| 119 | 117 |
| 120 </script> | 118 </script> |
| OLD | NEW |