5 Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=28633">Bug
28633 - Submitting a form with target=_blank works only once
</a>
8 This test will click the first submit button twice, then press the space bar on the second submit button twice. Both should popup two blank windows.
10 <form action=
"resources/submit-to-blank-multiple-times-form-action.html" target=
"_blank">
11 <input name=
"nextOp" id=
"nextOp" type=
"hidden">
12 <input name=
"submit" id=
"submit" type=
"submit">
14 <form action=
"resources/submit-to-blank-multiple-times-form-action.html" target=
"_blank">
15 <input name=
"nextOp" id=
"nextOpKey" type=
"hidden">
16 <input name=
"submit" id=
"submitKey" type=
"submit">
18 <div id=
"console"></div>
19 <script type=
"text/javascript">
20 if (window
.testRunner
) {
21 testRunner
.dumpAsText();
22 testRunner
.setCanOpenWindows();
23 testRunner
.waitUntilDone();
25 var numberTimesToClick
= 2;
26 var numberTimesToSpace
= 2;
27 window
.onload = function() {
28 if (!window
.testRunner
|| !window
.eventSender
)
32 // Set a timeout to notify done in case the test fails.
33 setTimeout(notifyDone
, 2000);
35 function log(message
) {
36 var span
= document
.createElement("span");
37 span
.innerHTML
= message
+ "<br>";
38 document
.getElementById("console").appendChild(span
);
41 log("Clicking first button, should open new window");
42 var button
= document
.getElementById("submit");
43 var x
= button
.offsetLeft
+ button
.offsetWidth
/2;
44 var y
= button
.offsetTop
+ button
.offsetHeight
/2;
47 if (numberTimesToClick
> 0)
48 document
.getElementById("nextOp").value
= "click";
50 document
.getElementById("nextOp").value
= "space";
51 eventSender
.mouseMoveTo(x
, y
);
52 eventSender
.mouseDown();
53 eventSender
.mouseUp();
55 function pressSpace() {
56 log("Pressing space on second button, should open new window");
57 var button
= document
.getElementById("submitKey");
60 if (numberTimesToSpace
> 0)
61 document
.getElementById("nextOpKey").value
= "space";
63 document
.getElementById("nextOpKey").value
= "notifyDone";
65 eventSender
.keyDown(' ');
67 function notifyDone() {
68 testRunner
.setCloseRemainingWindowsWhenComplete();
69 testRunner
.notifyDone();