- Revision
- 146223
- Author
- [email protected]
- Date
- 2013-03-19 11:13:39 -0700 (Tue, 19 Mar 2013)
Log Message
Merge 145735 "REGRESSION(r137607): Redirecting a post to a get then reloading triggers resubmit warning"
> .: Expose symbols for internals
> https://bugs.webkit.org/show_bug.cgi?id=112194
>
> Reviewed by Alexey Proskuryakov.
>
> * Source/autotools/symbols.filter:
>
> Source/WebCore: REGRESSION(r137607): Redirecting a post to a get then reloading triggers resubmit warning
> https://bugs.webkit.org/show_bug.cgi?id=112194
>
> Reviewed by Alexey Proskuryakov.
>
> Test: http/tests/navigation/post-redirect-get-reload.php
>
> * loader/SubresourceLoader.cpp:
> (WebCore::SubresourceLoader::willSendRequest): Matching urls aren't a reliable way of checking whether
> we are in a redirect. Check redirectResponse.isNull() instead.
> * testing/Internals.cpp:
> (WebCore::Internals::forceReload): Expose a means of forcing a reload like one a user generates for testing.
> Note that testRunner.queueReload() does this, but is not supported after the initial load completes,
> which makes it unsuitable for this case.
> * testing/Internals.h:
> * testing/Internals.idl:
>
> Source/WebKit/win: Expose symbols for internals
> https://bugs.webkit.org/show_bug.cgi?id=112194
>
> Reviewed by Alexey Proskuryakov.
>
> * WebKit.vcproj/WebKitExports.def.in:
>
> LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=112194.
>
> Reviewed by Alexey Proskuryakov.
>
> * http/tests/navigation/post-redirect-get-reload-expected.txt: Added.
> * http/tests/navigation/post-redirect-get-reload.php: Added.
>
[email protected]
Review URL: https://codereview.chromium.org/12568009
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1410/LayoutTests/http/tests/navigation/post-redirect-get-reload-expected.txt (from rev 145735, trunk/LayoutTests/http/tests/navigation/post-redirect-get-reload-expected.txt) (0 => 146223)
--- branches/chromium/1410/LayoutTests/http/tests/navigation/post-redirect-get-reload-expected.txt (rev 0)
+++ branches/chromium/1410/LayoutTests/http/tests/navigation/post-redirect-get-reload-expected.txt 2013-03-19 18:13:39 UTC (rev 146223)
@@ -0,0 +1,7 @@
+Policy delegate: attempt to load http://127.0.0.1:8000/navigation/post-redirect-get-reload.php with navigation type 'reload'
+1. Submit a form
+1a. The form redirects to a get.
+2. Reload
+
+The reload should not trigger a form resubmission warning.
+
Copied: branches/chromium/1410/LayoutTests/http/tests/navigation/post-redirect-get-reload.php (from rev 145735, trunk/LayoutTests/http/tests/navigation/post-redirect-get-reload.php) (0 => 146223)
--- branches/chromium/1410/LayoutTests/http/tests/navigation/post-redirect-get-reload.php (rev 0)
+++ branches/chromium/1410/LayoutTests/http/tests/navigation/post-redirect-get-reload.php 2013-03-19 18:13:39 UTC (rev 146223)
@@ -0,0 +1,29 @@
+<?php
+if($_SERVER['REQUEST_METHOD'] == "POST") {
+ header("Location: post-redirect-get-reload.php", true, 303);
+ exit;
+}
+?>
+<body>
+1. Submit a form<br>
+1a. The form redirects to a get.<br>
+2. Reload<br><br>
+The reload should not trigger a form resubmission warning.
+
+<form name="form" action="" method="post"><input type="submit"></input></form>
+<script>
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+
+ if (window.sessionStorage["prgl-state"] == null) {
+ window.sessionStorage["prgl-state"] = 'submitted';
+ document.form.submit();
+ } else {
+ window.sessionStorage.clear();
+ testRunner.waitForPolicyDelegate();
+ window.internals.forceReload(false);
+ }
+}
+</script>
Modified: branches/chromium/1410/Source/WebCore/loader/SubresourceLoader.cpp (146222 => 146223)
--- branches/chromium/1410/Source/WebCore/loader/SubresourceLoader.cpp 2013-03-19 17:52:35 UTC (rev 146222)
+++ branches/chromium/1410/Source/WebCore/loader/SubresourceLoader.cpp 2013-03-19 18:13:39 UTC (rev 146223)
@@ -131,7 +131,7 @@
RefPtr<SubresourceLoader> protect(this);
ASSERT(!newRequest.isNull());
- if (!previousURL.isNull() && previousURL != newRequest.url()) {
+ if (!redirectResponse.isNull()) {
if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) {
cancel();
return;
Modified: branches/chromium/1410/Source/WebCore/testing/Internals.cpp (146222 => 146223)
--- branches/chromium/1410/Source/WebCore/testing/Internals.cpp 2013-03-19 17:52:35 UTC (rev 146222)
+++ branches/chromium/1410/Source/WebCore/testing/Internals.cpp 2013-03-19 18:13:39 UTC (rev 146223)
@@ -46,6 +46,7 @@
#include "ExceptionCode.h"
#include "FormController.h"
#include "Frame.h"
+#include "FrameLoader.h"
#include "FrameView.h"
#include "HTMLContentElement.h"
#include "HTMLInputElement.h"
@@ -1947,6 +1948,11 @@
WebCore::Settings::setUsesOverlayScrollbars(enabled);
}
+void Internals::forceReload(bool endToEnd)
+{
+ frame()->loader()->reload(endToEnd);
+}
+
#if ENABLE(ENCRYPTED_MEDIA_V2)
void Internals::initializeMockCDM()
{
Modified: branches/chromium/1410/Source/WebCore/testing/Internals.h (146222 => 146223)
--- branches/chromium/1410/Source/WebCore/testing/Internals.h 2013-03-19 17:52:35 UTC (rev 146222)
+++ branches/chromium/1410/Source/WebCore/testing/Internals.h 2013-03-19 18:13:39 UTC (rev 146223)
@@ -281,6 +281,8 @@
String getCurrentCursorInfo(Document*, ExceptionCode&);
+ void forceReload(bool endToEnd);
+
#if ENABLE(ENCRYPTED_MEDIA_V2)
void initializeMockCDM();
#endif
Modified: branches/chromium/1410/Source/WebCore/testing/Internals.idl (146222 => 146223)
--- branches/chromium/1410/Source/WebCore/testing/Internals.idl 2013-03-19 17:52:35 UTC (rev 146222)
+++ branches/chromium/1410/Source/WebCore/testing/Internals.idl 2013-03-19 18:13:39 UTC (rev 146223)
@@ -250,5 +250,7 @@
void setUsesOverlayScrollbars(in boolean enabled);
+ void forceReload(in boolean endToEnd);
+
[Conditional=ENCRYPTED_MEDIA_V2] void initializeMockCDM();
};
Modified: branches/chromium/1410/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in (146222 => 146223)
--- branches/chromium/1410/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in 2013-03-19 17:52:35 UTC (rev 146222)
+++ branches/chromium/1410/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in 2013-03-19 18:13:39 UTC (rev 146223)
@@ -244,6 +244,7 @@
?paintControlTints@FrameView@WebCore@@AAEXXZ
?placeholderShouldBeVisible@HTMLTextFormControlElement@WebCore@@QBE_NXZ
?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVContainerNode@2@HH_N@Z
+ ?reload@FrameLoader@WebCore@@QAEX_N@Z
?remove@String@WTF@@QAEXIH@Z
?removedLastRef@Node@WebCore@@AAEXXZ
?reverseFind@StringImpl@WTF@@QAEI_WI@Z
Modified: branches/chromium/1410/Source/autotools/symbols.filter (146222 => 146223)
--- branches/chromium/1410/Source/autotools/symbols.filter 2013-03-19 17:52:35 UTC (rev 146222)
+++ branches/chromium/1410/Source/autotools/symbols.filter 2013-03-19 18:13:39 UTC (rev 146223)
@@ -242,6 +242,7 @@
_ZN7WebCore9FrameView17setTracksRepaintsEb;
_ZNK7WebCore5Frame25trackedRepaintRectsAsTextEv;
_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPN3WTF11ArrayBufferE;
+_ZN7WebCore11FrameLoader6reloadEb;
_ZN7WebCore13toArrayBufferEN3JSC7JSValueE;
_ZN7WebCore21SerializedScriptValue11deserializeEPN3JSC9ExecStateEPNS1_14JSGlobalObjectEPN3WTF6VectorINS6_6RefPtrINS_11MessagePortEEELj1EEENS_22SerializationErrorModeE;
_ZN7WebCore21SerializedScriptValue11deserializeEPN3JSC9ExecStateEPNS1_14JSGlobalObjectEPN3WTF6VectorINS6_6RefPtrINS_11MessagePortEEELm1EEENS_22SerializationErrorModeE;