| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| var cb = document.createElement("input"); |
| document.body.appendChild(cb); |
| description("This tests that clicking on indeterminate checkbox flips both checked/indeterminate states and calling preventDefault restores them."); |
| debug("Test if clicking on unchecked indeterminate checkbox flips both checked/indeterminate states"); |
| shouldBeTrue('cb.checked'); |
| shouldBeFalse('cb.indeterminate'); |
| debug("Test if clicking on checked indeterminate checkbox flips both checked/indeterminate states"); |
| shouldBeFalse('cb.checked'); |
| shouldBeFalse('cb.indeterminate'); |
| debug("Test if preventDefault restores the checked/indeterminate states"); |
| cb.onclick = function(e) { |
| shouldBeTrue('cb.checked'); |
| shouldBeFalse('cb.indeterminate'); |
| shouldBeFalse('cb.checked'); |
| shouldBeTrue('cb.indeterminate'); |
| <script src="../../resources/js-test-post.js"></script> |