Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / interactive-validation-cancel.html
blobeb9b7642c1977612ab2ae6d1596f90e29629ace9
1 <!DOCTYPE html>
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 <form id=f action="interactive-validation-cancel.html">
10 <input type=hidden name=submitted value="true">
11 <input name=i0 required id="i0">
12 <input type=submit id="s">
13 </form>
14 <script>
15 description('Test if the form is not submitted even if an "invalid" event for a control is canceled.');
17 function cancel(event) {
18 event.preventDefault();
21 function startOrVerify() {
22 var query = window.location.search;
23 if (query.indexOf('submitted=true') != -1) {
24 testFailed('The form should not be submitted.');
25 shouldBeTrue('location.search.indexOf("i0=") != -1');
26 } else {
27 document.getElementById('i0').addEventListener('invalid', cancel, false);
28 // HTMLFormElement::submit() skips validation. Use the submit button.
29 document.getElementById('s').click();
30 testPassed('The form was not submitted.');
32 debug('TEST COMPLETE');
33 if (window.testRunner)
34 testRunner.notifyDone();
37 if (window.testRunner)
38 testRunner.waitUntilDone();
39 window.onload = startOrVerify;
40 </script>
41 </body>
42 </html>