JS Test Harness: Insert the stylesheet dynamically
[WebKit-https.git] / LayoutTests / fast / forms / interactive-validation-novalidate.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <form id=f action="interactive-validation-novalidate.html" novalidate>
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 with novalidate is submitted.');
16
17 function startOrVerify() {
18     var query = window.location.search;
19     if (query.indexOf('submitted=true') != -1) {
20         testPassed('The form should not be submitted.');
21         shouldBeTrue('location.search.indexOf("i0=") != -1');
22         debug('TEST COMPLETE');
23         if (window.layoutTestController)
24             layoutTestController.notifyDone();
25     } else {
26         // HTMLFormElement::submit() skips validation. Use the submit button.
27         document.getElementById('s').click();
28         testFailed('The form was not submitted.');
29     }
30 }
31
32 if (window.layoutTestController)
33     layoutTestController.waitUntilDone();
34 window.onload = startOrVerify;
35 </script>
36 </body>
37 </html>