mjs | 06cc29f | 2005-10-04 04:08:04 +0000 | [diff] [blame] | 1 | <p>This test checks whether event.stopPropagation() prevents the |
| 2 | default action. It should not! If the default was prevented, you'll |
| 3 | see a link below and the text FAIL. On success you will see PASS. The |
| 4 | test should say PASS 4 times. |
| 5 | |
| 6 | </p> |
| 7 | <input type="checkbox" id="checkbox1" onclick="event.stopPropagation()" value="click here"> |
| 8 | <input type="checkbox" id="checkbox2" onclick="event.preventDefault()" value="click here"> |
| 9 | <p> |
| 10 | |
| 11 | <script> |
rniwa@webkit.org | ada3c20 | 2012-06-20 03:28:42 +0000 | [diff] [blame] | 12 | if (window.testRunner) |
| 13 | testRunner.dumpAsText(); |
mjs | 06cc29f | 2005-10-04 04:08:04 +0000 | [diff] [blame] | 14 | |
| 15 | var checkbox1 = document.getElementById("checkbox1"); |
| 16 | checkbox1.click(); |
| 17 | var checkbox2 = document.getElementById("checkbox2"); |
| 18 | checkbox2.click(); |
| 19 | |
| 20 | document.write(checkbox1.checked ? "PASS<br>" : "FAIL<br>"); |
| 21 | document.write(checkbox2.checked ? "FAIL<br>" : "PASS<br>"); |
| 22 | |
| 23 | </script> |