tkent@chromium.org | 70e5219 | 2010-04-09 18:03:06 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> |
| 5 | <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 6 | </head> |
| 7 | <body> |
| 8 | <p id="description"></p> |
| 9 | <div id="console"></div> |
| 10 | <form id=f action="interactive-validation-formnovalidate.html"> |
| 11 | <input type=hidden name=submitted value="true"> |
| 12 | <input name=i0 required id="i0"> |
| 13 | <input type=submit id="s" formnovalidate> |
| 14 | </form> |
| 15 | <script> |
| 16 | description('Test if the form is submitted with a submit button with formnovalidate.'); |
| 17 | |
| 18 | function startOrVerify() { |
| 19 | var query = window.location.search; |
| 20 | if (query.indexOf('submitted=true') != -1) { |
| 21 | testPassed('The form should not be submitted.'); |
| 22 | shouldBeTrue('location.search.indexOf("i0=") != -1'); |
| 23 | debug('TEST COMPLETE'); |
| 24 | if (window.layoutTestController) |
| 25 | layoutTestController.notifyDone(); |
| 26 | } else { |
| 27 | // HTMLFormElement::submit() skips validation. Use the submit button. |
| 28 | document.getElementById('s').click(); |
| 29 | testFailed('The form was not submitted.'); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | if (window.layoutTestController) |
| 34 | layoutTestController.waitUntilDone(); |
| 35 | window.onload = startOrVerify; |
| 36 | </script> |
| 37 | </body> |
| 38 | </html> |