| <script src="../../resources/js-test-pre.js"></script> |
| <form id=f action="interactive-validation-remove-node-in-handler.html"> |
| <input type=hidden name=submitted value="true"> |
| <input name=i0 required id="i0"> |
| <input type=submit id="s"> |
| description('Should not crash or have an assertion failure if a node was removed during an "invalid" event dispatching for the node.'); |
| function handler(event) { |
| node.parentNode.removeChild(node); |
| function startOrVerify() { |
| document.getElementById('i0').addEventListener('invalid', handler, false); |
| var query = window.location.search; |
| if (query.indexOf('submitted=true') != -1) { |
| testPassed('The form was submitted.'); |
| // HTMLFormElement::submit() skips validation. Use the submit button. |
| document.getElementById('s').click(); |
| // Should have no assertion failures. |
| testFailed('The form should be submitted.'); |
| testRunner.waitUntilDone(); |
| window.onload = startOrVerify; |