Index: LayoutTests/fast/forms/submit-onFocus-invalidForm.html |
diff --git a/LayoutTests/fast/forms/submit-onFocus-invalidForm.html b/LayoutTests/fast/forms/submit-onFocus-invalidForm.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e5d0afd23127f692e5cc3a1e2239662699c0aa62 |
--- /dev/null |
+++ b/LayoutTests/fast/forms/submit-onFocus-invalidForm.html |
@@ -0,0 +1,38 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<form method="GET" target="target" id="form"> |
+ <input name="query" value="AAA" pattern="banana|cherry" onfocus="onFocus(event)"/> |
+ <input type="submit" id="submitButton"/> |
+</form> |
+<iframe id="target" name="target"></iframe> |
+<script> |
+description('Test that form.submit() when called on "focus" event for invalid form should submit the form'); |
+ |
+function onFocus(event) { |
+ var form = document.getElementById('form'); |
+ form.action = '#foo'; |
+ form.submit(); |
+} |
+ |
+document.getElementById('target').onload = function(event) { |
+ // This should return back query AAA |
+ var query = event.target.contentWindow.location.search; |
+ if (query === '?query=AAA') { |
+ testPassed('Form is successfully submitted and content is loaded in the frame'); |
+ finishJSTest(); |
+ } |
+} |
+ |
+window.onload = function() { |
+ document.getElementById('submitButton').click(); |
+} |
+ |
+if (window.testRunner) |
+ window.jsTestIsAsync = true; |
+</script> |
+</body> |
+</html> |