4 <script src=
"../../resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
9 <form id=f
action=
"interactive-validation-remove-node-in-handler.html">
10 <input type=hidden name=submitted
value=
"true">
11 <input name=i0 required
id=
"i0">
12 <input type=submit
id=
"s">
15 description('Should not crash or have an assertion failure if a node was removed during an "invalid" event dispatching for the node.');
17 function handler(event
) {
18 var node
= event
.target
;
19 node
.parentNode
.removeChild(node
);
23 function startOrVerify() {
24 document
.getElementById('i0').addEventListener('invalid', handler
, false);
25 var query
= window
.location
.search
;
26 if (query
.indexOf('submitted=true') != -1) {
27 testPassed('The form was submitted.');
28 debug('TEST COMPLETE');
29 if (window
.testRunner
)
30 testRunner
.notifyDone();
32 // HTMLFormElement::submit() skips validation. Use the submit button.
33 document
.getElementById('s').click();
34 // Should have no assertion failures.
35 testFailed('The form should be submitted.');
39 if (window
.testRunner
)
40 testRunner
.waitUntilDone();
41 window
.onload
= startOrVerify
;