OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> |
| 3 <title>Selector: pseudo-classes (:indeterminate)</title> |
| 4 <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1> |
| 5 <link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=
link2> |
| 6 <script src="../../../../../../resources/testharness.js"></script> |
| 7 <script src="../../../../../../resources/testharnessreport.js"></script> |
| 8 <script src="utils.js"></script> |
| 9 <div id="log"></div> |
| 10 <input type=checkbox id=checkbox1> |
| 11 <input type=checkbox id=checkbox2> |
| 12 <input type=radio id=radio1 checked> |
| 13 <input type=radio name=radiogroup id=radio2> |
| 14 <input type=radio name=radiogroup id=radio3> |
| 15 <input type=radio name=group2 id=radio4> |
| 16 <input type=radio name=group2 id=radio5> |
| 17 <progress id="progress1"></progress> |
| 18 <progress id="progress2" value=10></progress> |
| 19 |
| 20 <script> |
| 21 testSelector(":indeterminate", ["radio2", "radio3", "radio4", "radio5", "progr
ess1"], "':progress' matches <input>s radio buttons whose radio button group con
tains no checked input and <progress> elements without value attribute"); |
| 22 |
| 23 document.getElementById("radio2").setAttribute("checked", "checked"); |
| 24 testSelector(":indeterminate", ["radio4", "radio5", "progress1"], "dynamically
check a radio input in a radio button group"); |
| 25 |
| 26 document.getElementById("radio4").click(); |
| 27 testSelector(":indeterminate", ["checkbox1", "progress2"], "click on radio4 wh
ich is in the indeterminate state"); |
| 28 |
| 29 document.getElementById("progress1").setAttribute("value", "20"); |
| 30 testSelector(":indeterminate", [], "adding a value to progress1 should put it
in a determinate state"); |
| 31 |
| 32 document.getElementById("progress2").removeAttribute("value"); |
| 33 testSelector(":indeterminate", ["progress2"], "removing progress2's value shou
ld put it in an indeterminate state"); |
| 34 |
| 35 document.getElementById("checkbox1").indeterminate = true; // set checkbox1 in
the indeterminate state |
| 36 testSelector(":indeterminate", ["checkbox1", "progress2"], "':progress' also m
atches <input> checkbox whose indeterminate IDL is set to true"); |
| 37 </script> |
OLD | NEW |