Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / checkbox-click-indeterminate.html
blob5406e009b4fc3a63cd3ef7dcbeeab1e02cf750c9
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 var cb = document.createElement("input");
11 document.body.appendChild(cb);
12 cb.type = "checkbox";
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");
17 cb.checked = false;
18 cb.indeterminate = true;
19 cb.click();
20 shouldBeTrue('cb.checked');
21 shouldBeFalse('cb.indeterminate');
23 debug("Test if clicking on checked indeterminate checkbox flips both checked/indeterminate states");
24 cb.checked = true;
25 cb.indeterminate = true;
26 cb.click();
27 shouldBeFalse('cb.checked');
28 shouldBeFalse('cb.indeterminate');
30 debug("Test if preventDefault restores the checked/indeterminate states");
31 cb.checked = false;
32 cb.indeterminate = true;
33 cb.onclick = function(e) {
34 shouldBeTrue('cb.checked');
35 shouldBeFalse('cb.indeterminate');
36 e.preventDefault();
38 cb.click();
39 shouldBeFalse('cb.checked');
40 shouldBeTrue('cb.indeterminate');
41 </script>
42 </body>
43 </html>