Diff
Modified: branches/safari-534.52-branch/LayoutTests/ChangeLog (98134 => 98135)
--- branches/safari-534.52-branch/LayoutTests/ChangeLog 2011-10-21 20:37:59 UTC (rev 98134)
+++ branches/safari-534.52-branch/LayoutTests/ChangeLog 2011-10-21 20:48:50 UTC (rev 98135)
@@ -1,3 +1,20 @@
+2011-10-21 Lucas Forschler <lforsch...@apple.com>
+
+ Merge 95226
+
+ 2011-09-15 Jon Lee <jon...@apple.com>
+
+ Submitting a form with target=_blank works only once
+ https://bugs.webkit.org/show_bug.cgi?id=28633
+ <rdar://problem/7357787>
+
+ Reviewed by Andy Estes.
+
+ New test that simulates mouse clicking submit button twice (which didn't work), as well as using the keyboard twice (which did work).
+
+ * fast/forms/resources/submit-to-blank-multiple-times-form-action.html: Added.
+ * fast/forms/submit-to-blank-multiple-times-expected.txt: Added.
+ * fast/forms/submit-to-blank-multiple-times.html: Added.
2011-09-15 Mark Rowe <mr...@apple.com>
Merge r89705.
Copied: branches/safari-534.52-branch/LayoutTests/fast/forms/resources/submit-to-blank-multiple-times-form-action.html (from rev 95226, trunk/LayoutTests/fast/forms/resources/submit-to-blank-multiple-times-form-action.html) (0 => 98135)
--- branches/safari-534.52-branch/LayoutTests/fast/forms/resources/submit-to-blank-multiple-times-form-action.html (rev 0)
+++ branches/safari-534.52-branch/LayoutTests/fast/forms/resources/submit-to-blank-multiple-times-form-action.html 2011-10-21 20:48:50 UTC (rev 98135)
@@ -0,0 +1,17 @@
+<script>
+if (opener) {
+ opener.log("PASS");
+
+ var result = {}, queryString = location.search.substring(1),
+ re = /([^&=]+)=([^&]*)/g, m;
+ while (m = re.exec(queryString)) {
+ result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
+ }
+ if (result["nextOp"] == "click" && opener.click)
+ opener.click();
+ else if (result["nextOp"] == "space" && opener.pressSpace)
+ opener.pressSpace();
+ else if (result["nextOp"] == "notifyDone" && opener.notifyDone)
+ opener.notifyDone();
+}
+</script>
\ No newline at end of file
Copied: branches/safari-534.52-branch/LayoutTests/fast/forms/submit-to-blank-multiple-times-expected.txt (from rev 95226, trunk/LayoutTests/fast/forms/submit-to-blank-multiple-times-expected.txt) (0 => 98135)
--- branches/safari-534.52-branch/LayoutTests/fast/forms/submit-to-blank-multiple-times-expected.txt (rev 0)
+++ branches/safari-534.52-branch/LayoutTests/fast/forms/submit-to-blank-multiple-times-expected.txt 2011-10-21 20:48:50 UTC (rev 98135)
@@ -0,0 +1,15 @@
+Test for Bug 28633 - Submitting a form with target=_blank works only once
+
+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.
+
+
+
+Clicking first button, should open new window
+PASS
+Clicking first button, should open new window
+PASS
+Pressing space on second button, should open new window
+PASS
+Pressing space on second button, should open new window
+PASS
+
Copied: branches/safari-534.52-branch/LayoutTests/fast/forms/submit-to-blank-multiple-times.html (from rev 95226, trunk/LayoutTests/fast/forms/submit-to-blank-multiple-times.html) (0 => 98135)
--- branches/safari-534.52-branch/LayoutTests/fast/forms/submit-to-blank-multiple-times.html (rev 0)
+++ branches/safari-534.52-branch/LayoutTests/fast/forms/submit-to-blank-multiple-times.html 2011-10-21 20:48:50 UTC (rev 98135)
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <p>
+ Test for <a href="" 28633 - Submitting a form with target=_blank works only once</a>
+ </p>
+ <p>
+ 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.
+ </p>
+ <form action="" target="_blank">
+ <input name="nextOp" id="nextOp" type="hidden">
+ <input name="submit" id="submit" type="submit">
+ </form>
+ <form action="" target="_blank">
+ <input name="nextOp" id="nextOpKey" type="hidden">
+ <input name="submit" id="submitKey" type="submit">
+ </form>
+ <div id="console"></div>
+ <script type="text/_javascript_">
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.setCanOpenWindows();
+ layoutTestController.waitUntilDone();
+ }
+ var numberTimesToClick = 2;
+ var numberTimesToSpace = 2;
+ window._onload_ = function() {
+ if (!window.layoutTestController || !window.eventSender)
+ return;
+
+ click();
+ // Set a timeout to notify done in case the test fails.
+ setTimeout(notifyDone, 2000);
+ };
+ function log(message) {
+ var span = document.createElement("span");
+ span.innerHTML = message + "<br>";
+ document.getElementById("console").appendChild(span);
+ }
+ function click() {
+ log("Clicking first button, should open new window");
+ var button = document.getElementById("submit");
+ var x = button.offsetLeft + button.offsetWidth/2;
+ var y = button.offsetTop + button.offsetHeight/2;
+
+ numberTimesToClick--;
+ if (numberTimesToClick > 0)
+ document.getElementById("nextOp").value = "click";
+ else
+ document.getElementById("nextOp").value = "space";
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ function pressSpace() {
+ log("Pressing space on second button, should open new window");
+ var button = document.getElementById("submitKey");
+
+ numberTimesToSpace--;
+ if (numberTimesToSpace > 0)
+ document.getElementById("nextOpKey").value = "space";
+ else
+ document.getElementById("nextOpKey").value = "notifyDone";
+ button.focus();
+ eventSender.keyDown(' ');
+ }
+ function notifyDone() {
+ layoutTestController.setCloseRemainingWindowsWhenComplete();
+ layoutTestController.notifyDone();
+ }
+ </script>
+ </body>
+</html>
Modified: branches/safari-534.52-branch/Source/WebCore/ChangeLog (98134 => 98135)
--- branches/safari-534.52-branch/Source/WebCore/ChangeLog 2011-10-21 20:37:59 UTC (rev 98134)
+++ branches/safari-534.52-branch/Source/WebCore/ChangeLog 2011-10-21 20:48:50 UTC (rev 98135)
@@ -1,5 +1,29 @@
2011-10-21 Lucas Forschler <lforsch...@apple.com>
+ Merge 95226
+
+ 2011-09-15 Jon Lee <jon...@apple.com>
+
+ Submitting a form with target=_blank works only once
+ https://bugs.webkit.org/show_bug.cgi?id=28633
+ <rdar://problem/7357787>
+
+ Reviewed by Andy Estes.
+
+ Test: fast/forms/submit-to-blank-multiple-times.html
+
+ The call to reset the multiple form submission bool is pushed down from the mouseDown handler to
+ handleMousePressEvent(), to include WK2 coverage, similar to keyEvent.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleMousePressEvent):
+ (WebCore::EventHandler::keyEvent): clarified old FIXME comment. Both key events and mouse events
+ may submit a form multiple times, but the call to reset the handler should probably be in another
+ abstraction layer.
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::mouseDown):
+2011-10-21 Lucas Forschler <lforsch...@apple.com>
+
Merge 94371
2011-09-01 Ada Chan <adac...@apple.com>
Modified: branches/safari-534.52-branch/Source/WebCore/page/EventHandler.cpp (98134 => 98135)
--- branches/safari-534.52-branch/Source/WebCore/page/EventHandler.cpp 2011-10-21 20:37:59 UTC (rev 98134)
+++ branches/safari-534.52-branch/Source/WebCore/page/EventHandler.cpp 2011-10-21 20:48:50 UTC (rev 98135)
@@ -1346,6 +1346,9 @@
UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+ // FIXME (bug 68185): this call should be made at another abstraction layer
+ m_frame->loader()->resetMultipleFormSubmissionProtection();
+
cancelFakeMouseMoveEvent();
m_mousePressed = true;
m_capturesDragging = true;
@@ -2477,7 +2480,7 @@
if (FrameView* view = m_frame->view())
view->resetDeferredRepaintDelay();
- // FIXME: what is this doing here, in keyboard event handler?
+ // FIXME (bug 68185): this call should be made at another abstraction layer
m_frame->loader()->resetMultipleFormSubmissionProtection();
// In IE, access keys are special, they are handled after default keydown processing, but cannot be canceled - this is hard to match.
Modified: branches/safari-534.52-branch/Source/WebCore/page/mac/EventHandlerMac.mm (98134 => 98135)
--- branches/safari-534.52-branch/Source/WebCore/page/mac/EventHandlerMac.mm 2011-10-21 20:37:59 UTC (rev 98134)
+++ branches/safari-534.52-branch/Source/WebCore/page/mac/EventHandlerMac.mm 2011-10-21 20:48:50 UTC (rev 98135)
@@ -477,8 +477,6 @@
BEGIN_BLOCK_OBJC_EXCEPTIONS;
- m_frame->loader()->resetMultipleFormSubmissionProtection();
-
m_mouseDownView = nil;
CurrentEventScope scope(event);
Modified: branches/safari-534.52-branch/Source/WebKit/chromium/ChangeLog (98134 => 98135)
--- branches/safari-534.52-branch/Source/WebKit/chromium/ChangeLog 2011-10-21 20:37:59 UTC (rev 98134)
+++ branches/safari-534.52-branch/Source/WebKit/chromium/ChangeLog 2011-10-21 20:48:50 UTC (rev 98135)
@@ -1,3 +1,19 @@
+2011-10-21 Lucas Forschler <lforsch...@apple.com>
+
+ Merge 95226
+
+ 2011-09-15 Jon Lee <jon...@apple.com>
+
+ Submitting a form with target=_blank works only once
+ https://bugs.webkit.org/show_bug.cgi?id=28633
+ <rdar://problem/7357787>
+
+ Reviewed by Andy Estes.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::mouseDown): Remove call to resetMultipleFormSubmissionProtection() since
+ it will be made in platform-independent function EventHandler::handleMousePressEvent().
+
2011-08-11 Lucas Forschler <lforsch...@apple.com>
Merged 92384
Modified: branches/safari-534.52-branch/Source/WebKit/chromium/src/WebViewImpl.cpp (98134 => 98135)
--- branches/safari-534.52-branch/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-10-21 20:37:59 UTC (rev 98134)
+++ branches/safari-534.52-branch/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-10-21 20:48:50 UTC (rev 98135)
@@ -468,8 +468,6 @@
}
}
- mainFrameImpl()->frame()->loader()->resetMultipleFormSubmissionProtection();
-
mainFrameImpl()->frame()->eventHandler()->handleMousePressEvent(
PlatformMouseEventBuilder(mainFrameImpl()->frameView(), event));