OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <form method="GET" target="target" id="form"> |
| 8 <input name="query" value="AAA" pattern="banana|cherry" onfocus="onFocus(e
vent)"/> |
| 9 <input type="submit" id="submitButton"/> |
| 10 </form> |
| 11 <iframe id="target" name="target"></iframe> |
| 12 <script> |
| 13 description('Test that form.submit() when called on "focus" event for invalid fo
rm should submit the form'); |
| 14 |
| 15 function onFocus(event) { |
| 16 var form = document.getElementById('form'); |
| 17 form.action = '#foo'; |
| 18 form.submit(); |
| 19 } |
| 20 |
| 21 document.getElementById('target').onload = function(event) { |
| 22 // This should return back query AAA |
| 23 var query = event.target.contentWindow.location.search; |
| 24 if (query === '?query=AAA') { |
| 25 testPassed('Form is successfully submitted and content is loaded in the
frame'); |
| 26 finishJSTest(); |
| 27 } |
| 28 } |
| 29 |
| 30 window.onload = function() { |
| 31 document.getElementById('submitButton').click(); |
| 32 } |
| 33 |
| 34 if (window.testRunner) |
| 35 window.jsTestIsAsync = true; |
| 36 </script> |
| 37 </body> |
| 38 </html> |
OLD | NEW |