1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
10 var cb
= document
.createElement("input");
11 document
.body
.appendChild(cb
);
14 description("This tests that clicking on indeterminate checkbox flips both checked/indeterminate states and calling preventDefault restores them.");
16 debug("Test if clicking on unchecked indeterminate checkbox flips both checked/indeterminate states");
18 cb
.indeterminate
= true;
20 shouldBeTrue('cb.checked');
21 shouldBeFalse('cb.indeterminate');
23 debug("Test if clicking on checked indeterminate checkbox flips both checked/indeterminate states");
25 cb
.indeterminate
= true;
27 shouldBeFalse('cb.checked');
28 shouldBeFalse('cb.indeterminate');
30 debug("Test if preventDefault restores the checked/indeterminate states");
32 cb
.indeterminate
= true;
33 cb
.onclick = function(e
) {
34 shouldBeTrue('cb.checked');
35 shouldBeFalse('cb.indeterminate');
39 shouldBeFalse('cb.checked');
40 shouldBeTrue('cb.indeterminate');